-1

ive written this code to clear blue from a picture:

def clearBlue(picture):
  for p in getPixels(picture):
    setBlue(p,0)

Now i need to maximize the blue in the image(255), how can do that with this code?

1 Answers1

0

Your function is called clearBlue which insinuates that you don't want the blue element, but you're asking to maximize the Blue component, which is confusing.

You were on the right track, but to maximise the blue to the greatest possible value (in 24-bit colours) is:

def clearBlue(picture):
  for p in getPixels(picture):
    setBlue(p, 255)
Ari
  • 745
  • 1
  • 7
  • 23