Is it possible to represent all the RGB different colors in a linear way, 
instead of by a tuple (R, G, B)?

I am asking because I want to delete all shades of blue in an image, like (0, 
0, 255) and (51, 0, 255), for example. The problem is that if I set a range 
using < and >, (see below) it is going to affect other colors in between, like 
(51, 0, 0), which is far from being blue. here is the code that is not working 
properly:

for x in range(width):
        for y in range(height):
            if pixels[x, y] >= (0, 0, 255):
                if pixels[x, y] <= (51, 0, 255):
                    pixels[x, y] = (255, 255, 255)

If I could represent all the shades of a particular color in a linear way, then 
using < and > would work. Also, the images I am working with were scanned so 
that's the reason way the pixels don't have an even color. I am open to other 
solutions as well.

Thanks,

Eduardo



_________________________________________________________________
Messenger 2009: Instale já!
http://download.live.com
_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to