Performance of reading from Jpeg

Remember that this has to read the image and decompress it. You're
talking about a 30MB bitmap, and it just takes time to do that
decompression. It would be worth trying PIL, but you'll still have to
decompress it to display it.

···

On Tue, 21 Apr 2009 13:49:37 -0400, Dave Angel <davea@ieee.org> wrote:

My problem is that images are taking too long to display. From my
measurements, most of the time (0.5 to 0.8 secs for each image) is
spent in the line:
                   self._img = wx.Image(self.fname, wx.BITMAP_TYPE_ANY)

I am also potentially rotating the image, and of course I copy/scale
it (or a crop of it) to a DC. But it appears the line above is the
real bottleneck.

The jpeg images are at approximate resolution 3800x2600 pixels. I
could pre-process them for a smaller size, but I'd rather not. The
second monitor is 1920x1080, and I will be displaying a crop of the
original image.

Could some other format help? Or using PIL or something else to store
this (intermediate) image?

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Tim Roberts wrote:

···

On Tue, 21 Apr 2009 13:49:37 -0400, Dave Angel <davea@ieee.org> wrote:
  

My problem is that images are taking too long to display. From my
measurements, most of the time (0.5 to 0.8 secs for each image) is
spent in the line:
                   self._img = wx.Image(self.fname, wx.BITMAP_TYPE_ANY)

I am also potentially rotating the image, and of course I copy/scale
it (or a crop of it) to a DC. But it appears the line above is the
real bottleneck.

The jpeg images are at approximate resolution 3800x2600 pixels. I
could pre-process them for a smaller size, but I'd rather not. The
second monitor is 1920x1080, and I will be displaying a crop of the
original image.

Could some other format help? Or using PIL or something else to store
this (intermediate) image?
    
Remember that this has to read the image and decompress it. You're
talking about a 30MB bitmap, and it just takes time to do that
decompression. It would be worth trying PIL, but you'll still have to
decompress it to display it.

I agree. Just use some kind of progress bar or some other way to let the user know that the image will be displayed soon.

Mike

Tim Roberts wrote:

Remember that this has to read the image and decompress it. You're
talking about a 30MB bitmap, and it just takes time to do that
decompression. It would be worth trying PIL, but you'll still have to
decompress it to display it.

and both PIL and wx use libjpeg, so I doubt you're going to see much improvement -- and I suspect much of the time is disk IO/O anyway.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov