Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Thumbnail creation with small memory footprint.

Thread view: 
gbrun - 19 Feb 2006 10:47 GMT
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.
Andrey Kuznetsov - 19 Feb 2006 11:35 GMT
> My aim is to generate a thumbnail image (80x80 jpeg)
> from a source image that can have a HUGE resolution (more than 3200x2000).
[quoted text clipped - 9 lines]
>
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.