Thumbnail creation with small memory footprint.

G

gbrun

My aim is to generate a thumbnail image (80x80 jpeg)
from a source image that can have a HUGE resolution (more than 3200x2000).

But all the API that i found use a unpacked memory version of the source
image
that of course can't be allocated, so i got a "out of memory".

Does anyone know an API or method to scale down an image
with small memory footprint by generating the result image in a flow ?

i m using 1.4.2 JDK on AIX.

thanks in advance.
 
A

Andrey Kuznetsov

My aim is to generate a thumbnail image (80x80 jpeg)
from a source image that can have a HUGE resolution (more than 3200x2000).

But all the API that i found use a unpacked memory version of the source
image
that of course can't be allocated, so i got a "out of memory".

Does anyone know an API or method to scale down an image
with small memory footprint by generating the result image in a flow ?

i m using 1.4.2 JDK on AIX.

thanks in advance.

with Imagero Reader you can minimize memory footpring with following:
1) JpegReader.setSubsampling(8) so that only DC-coeffs are read (400x250)
and
2) set scaling options in ImageProducerAdapter:
ImageProducerAdapter.setOptimizeScalingFor(ImageProducerAdapter.OPTIMIZE_SCALING_MEMORY);
so that only amount of input rows needed to get one output row are held in
memory
(with subsampling 8 - only 4 rows, without subsampling 25 rows).

Note that Imagero's scaling is good for following scale factors: 2.0, 1.0
(if you need to antialias your picture), 0.5, 0.25, 0.125 and so on, for
other scale factors I recommend to combine subsampling with
AreaAveragingScaleFilter

see http://reader.imagero.com for more info

--

Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,043
Members
48,769
Latest member
Clifft

Latest Threads

Top