You can be a bit more efficient by reading the file into the PIL image, and keeping a reference to to that image object even after you have converted it to a wx.Bitmap for display. Then when an adjustment needs to be made you do it to the PIL image and convert to a new wx.Bitmap. This saves the overhead of converting from a wx.Bitmap to a PIL image each time, as the converts only go in the other direction.
···
On 3/2/11 9:01 AM, BirdaoGwra wrote:
Hi Ray,
Before modifying the image I have to draw it on dc so that I(or
someone) can see the image. There are two sliders to adjust the
brightness/contrast. That's why I am reading the image with wx than
converting it into pil for the b/c adjustment. Than again converting
it into wx to redraw. Isn't it right way to do this?
On Mar 2, 10:22 am, Robin Dunn <ro...@alldunn.com> wrote:
On 3/2/11 9:01 AM, BirdaoGwra wrote:
> Hi Ray,
> Before modifying the image I have to draw it on dc so that I(or
> someone) can see the image. There are two sliders to adjust the
> brightness/contrast. That's why I am reading the image with wx than
> converting it into pil for the b/c adjustment. Than again converting
> it into wx to redraw. Isn't it right way to do this?
You can be a bit more efficient by reading the file into the PIL image,
and keeping a reference to to that image object even after you have
converted it to a wx.Bitmap for display. Then when an adjustment needs
to be made you do it to the PIL image and convert to a new wx.Bitmap.
This saves the overhead of converting from a wx.Bitmap to a PIL image
each time, as the converts only go in the other direction.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org