Hi,
I scanned a color page from a book and I would like to remove specific colors
from it. The page was scanned at 300dpi.
Suppose I wanted to remove the blue color of the image; because the quality of
the color is not even, I had the blue color in different levels, apparently
from (185, 208, 231) to (207, 240, 255) - I used "Little RGB Color Picker" to
find that out. I tried the following:
[code]
im = Image.open("C:\Scan_119.jpg")
im.show()
pixels = im.load()
width, height = im.size
for x in range(width):
for y in range(height):
if pixels[x, y] >= (185, 208, 231):
if pixels[x, y] <= (207, 240, 255):
pixels[x, y] = (255, 255, 255)
[\code]
But it had little success removing the blue color - I suppose due to the
complexity of stablishing a range between two tuples of 3 values. How can I
efficiently set a color range to be found or removed with PIL? Is there an
algorithm to find such range?
Thanks,
Eduardo
_________________________________________________________________
Faça já uma busa e ganhe um wink do Messenger. Está esperando o que? É grátis!
http://www.ibud.com.br/
_______________________________________________
Image-SIG maillist - Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig