Re: Looking for a *FAST* graphics library
- From: Logan Shaw <lshaw-usenet@xxxxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 19:55:18 -0500
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
.
- References:
- Looking for a *FAST* graphics library
- From: cartoper
- Looking for a *FAST* graphics library
- Prev by Date: Web-based personal development co. looking for programmers
- Next by Date: Re: A graph problem
- Previous by thread: Re: Looking for a *FAST* graphics library
- Next by thread: Implementing a Network Protocol
- Index(es):
Relevant Pages
|