title: Converting pixel colors to probabilities (Python)
body: <p>I need to develop an algorithm that assigns a probability to each pixel of a picture according to its RGB color code. If the pixel is completely red the probability is one. The probability lowers the less red the pixel gets. The blue pixels should be assigned with the lowest probability. I work with python. Thanks a lot for your help!<br>
  <a href="https://i.stack.imgur.com/TjUEW.png" rel="nofollow noreferrer">Color pattern of interest</a></p>