I need to make a widget that allows the user to adjust the gamma on a bitmap. The problem is that the bitmap is using bytes for each of it’s color channels. Therefore some sort of gamma correction table is needed to adjust the unsigned int values in the image. How do I adjust the rgb components of the image by piping them through a gamma correction table without copying the pixel data and iterating through each rgb component and making a new data table and recreating the Image (which would be slow)?
-M
···
Give to a good cause with every e-mail. [Join the i’m Initiative from Microsoft.](http://im.live.com/Messenger/IM/Join/Default.aspx?souce=EML_WL_ GoodCause)
Not to pull this conversation off topic, but has anyone ever written a wxPython-specific wrapper for PiL or ImageMagic to allow you to move bitmaps in and out of these modules? I tried messing with PiL recently but the only way I could make PiL & wxPython “play” was to save a wxPython bitmap to file, manipulate the file with PiL, and then bring the file back in. I couldn’t find a good way to fake a file since wxPython wanted a filename instead of a file handle.
If no (if no one has written one), then this would be a damned fine project for someone to tackle. I bet lots of people would find that useful.
Gre7g
···
On 5/17/08, Gre7g Luterman gre7g.luterman@gmail.com wrote:
Look into python image library (PiL) or ImageMagick. They don’t interface as nicely as I would want with wxPython, but it will beat the heck out of doing it yourself pixel-by-pixel!