Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Thumbnail creation with small memory footprint.

Reply
Thread Tools

Thumbnail creation with small memory footprint.

 
 
gbrun
Guest
Posts: n/a
 
      02-19-2006
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.
 
Reply With Quote
 
 
 
 
Andrey Kuznetsov
Guest
Posts: n/a
 
      02-19-2006
> 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( so that only DC-coeffs are read (400x250)
and
2) set scaling options in ImageProducerAdapter:
ImageProducerAdapter.setOptimizeScalingFor(ImagePr oducerAdapter.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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Small cameras getting too small? GRL Digital Photography 50 02-03-2006 03:12 AM
Displaying a Thumbnail vs. creating a thumbnail David Lozzi ASP .Net 1 02-01-2006 10:34 PM
Small Square with small red X Peter Coddington Computer Support 4 01-03-2006 06:58 AM
How to (batch) set EXIF date taken and IPTC creation date and creation time for photos with filenames YYMMDDHHMMSS#.jpg? guercheLE@gmail.com Digital Photography 1 10-04-2005 07:15 PM
Thumbnail creation problem. really weird. hilz Java 6 09-20-2004 07:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57