[Image-SIG] Re: PIL image processing
Ajay Abhyankar
ajay at holonix.com.sg
Tue Nov 9 10:18:43 CET 2004
Fredrik Lundh wrote:
>Ajay Abhyankar wrote:
>
>
>
>>I have used lookup table for controlling the threshold of an image using the point(table) method.
>>To set the threshold of an image, I create a list of 256 values. All values till threshold (in
>>range 0-255) are turned to 0 and the rest above threshold value are turned to 255. This list is
>>supplied to the point method as lookup table. When applied to the image it works fine.
>>
>>Similarly, if I want to manipulate Brightness/Contrast of an image using lookup table for an
>>image, how can I get the lookup table for an image with existing values (so as to manipulate them)
>>instead of creating a new lookup table.
>>
>>
>
>images don't have lookup tables; the point method maps the pixel values
>through the table you provided, and returns a new image.
>
>to create a linear lookup table, use "lut = range(256)"
>
></F>
>
>
>
>
>_______________________________________________
>Image-SIG maillist - Image-SIG at python.org
>http://mail.python.org/mailman/listinfo/image-sig
>
>
>
>
>
Hi,
Thanks for the reply.
I was able to change the brightness/contrast using the point method.
out = im.point(lambda i: i * factor).
Regards,
Ajay
More information about the Image-SIG
mailing list