Re: Looking for a *FAST* graphics library



cartoper@xxxxxxxxx wrote:
I am working on writing an Apache Module (in C/C++) that needs to
resize (down) large images (4MB to 16MB) VERY quickly. The objective
is not to make the images look great for printing, just look good on
the screen as low rez (900x600 max). Initally I was doing this
in .Net, to downsize a 6MP image, it took around 0.5 seconds to read
in, downsize, and save the image. The main problem with .Net is that
it is not crossplate, I am porting this code to run on both Windows
and *NIX.

I can't help you advice about specific libraries, but I would like to
point out that you may want to look at which step of the process is
the slow one, since that might yield insight about ways to speed it
up.

For example, if you are loading a JPEG image, then scaling it down and
saving it as a JPEG image again, it may be that the JPEG decoding and
encoding is the slow part and not the image scaling itself. In particular,
I know with the IJG JPEG library (which is very widely used), you can
ask the library to scale by factors of 1/2, 1/4, or 1/8. A naive
implementation would simply ask the JPEG library to decode at full
resolution, then scale that down, whereas a smarter implementation
would check first to see if 1/2, 1/4, or 1/8 scaling could be applied
and still end up with a decoded image that is larger than the desired
output; if so, it'll be faster to have the IJG JPEG library do that
because it actually means *less* processing to decode the JPEG data.
(And of course it would also mean less input data for the scaling
routine to process.)

Of course, that's just a specific example and I don't even know if
your image format is JPEG, but the point here is to look at the whole
process.

- Logan
.



Relevant Pages

  • Re: RAW images...
    ... but I didn't even suggest that quantisation changes only applied to resizing lossy formats. ... Hence the problem is not limited to JPEG specifically or lossy formats in general. ... your example was at 95% scaling between original and JPEG saved versions. ... There has been no distortion. ...
    (rec.photo.digital)
  • scaling and positioning a jpeg that is too large
    ... Where can I learn more about scaling down a jpeg that I've included in ... \caption{Map of the United States} ... The map that appears is too far to the right, ... bottom right of the jpeg. ...
    (comp.text.tex)
  • Re: Decoding a JPEG in memory
    ... >having great difficulty in finding a library or source code to decode a ... >JPEG image that I have in memory. ... >image in memory and would like to call a lib function to decode the ... custom data source manager. ...
    (comp.compression)
  • Decoding progressive JPEG with low memory consumption
    ... The input JPEG images can are usually some mega pixels large and I have to decode these only a small screen canvas. ... I do not have this much memory available, hence my only option seems to be decoding the image from scratch for each pass/scan. ...
    (comp.graphics.algorithms)
  • Re: Raw vs jpeg
    ... In these circumstances RAW wins hands down because you do not get the JPEG subsampled chroma problems damaging the image resolution. ... In general for images containing areas of white or black with sharp edges there are values in the reconstruction after inverting the quantised coefficients through the DCT that are outside the allowed range of 0..255. ... If you decode again to a colour image you will see the luminance error smearing from the chroma and convert that to monochrome and you do not get the right answer. ... Most digital cameras that I have seen use the default Huffman tables from the JPEG standard App K.3. ...
    (rec.photo.digital)