0

I'm programming a gui and is looking for a method to control the brightness of my image using a slider. i've tried using ConvertToGreyscale but it is not giving what i want since images are in RGB and ConvertToGreyscale is in YUV.

i know that PIL have a lot of capabilities for images processing but i will have to convert between wximage, bitmap and PILimage. tried looking at http://wiki.wxpython.org/WorkingWithImages but solutions there doesn't seem to be working.

assistance is greatly appreciated.

4

1 回答 1

0

要更改亮度,您通常只需将像素值乘以一个常数。如果常数小于 1.0,它会变暗,如果它更大,它会变亮。使用 PIL 可能有多种方法可以做到这一点,但首先想到的是Image.eval函数:

k = 1.5
out = Image.eval(in, lambda x: int(x * k))

在此处输入图像描述

于 2013-08-31T16:57:40.697 回答