My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Introduction  
A short introduction to the library
Featured, Phase-Design
Updated Mar 14, 2009 by m%nobel-...@gtempaccount.com

Introduction

A description of why this library should be used.

Details

The core Java libraries has been capable of scaling images since the very first release of Java. In general there is two ways of scaling a image object:

  • Image.getScaledInstance() (You hint the scaling quality as a parameter to the method).
  • Scaling by creating a new Image object and draw a scaled version of the image to that (Graphics2D let you set the interpolater method used)

The Image.getScaledInstance() approach creates a quite good scaling quality but is terrible slow. The second approach is fast but to create good looking result, you scaling must be between factor 2.0 and 0.5. (If your scaling is outside this range, you should run the algorithm multiple times - See Chris Campbell's blog The Perils of Image.getScaledInstance()).

This library improve both methods. First of all the library has a abstract class AdvancedResizeOp that add the following features:

  • You can specify you target size using a DimensionConstrain object. This helps you with maintaining the aspect radio in your resizing.
  • You can add a progress changed listener to get feedback of how your resizing calculation is doing
  • You can run a unsharpen filter when reducing the size of the image. This will improve the quality of the rescaled image. (This depends on the third-party library JHLabs: Java Image Filters).

The MultiStepRescaleOp class

This class is based on Chris Cambell's work, so it generally just encapsulate the algorithm Chris described.

  • Low memory usage

The ResampleOp class

  • Add multicore support
  • Choose between different interpolator algorithms (such as BiCubic and Lanczos3).
  • Very high memory usage

Quality

The following shows you the result of a image scaled using this library.

Comment by gloger.m...@gmail.com, Jun 15, 2011

I'm so surprised that there is no comment or other kind words from users to thank you for this great library. THANKS was searching exactly for this "only" few days :)

Comment by thunderc...@gmail.com, Jun 27, 2011

I am about to use this library in my project i have just checked out the info on this site about your library and it is what i´ve been searching for, the other stuff i used to make this task in java did not satisfy my needs, i can see that this one is much better than the rest, Thanks for doing this kind of stuff.

Comment by jianjun....@sambaash.com, Jun 29, 2011

Thank you so much for this, the quality of scaled image is much better than others. One thing i cannot figure out is how to come out the different results (image)you are showing above. Thanks a lot if anyone can tell me.

Comment by nathanie...@gmail.com, Apr 9, 2012

Can't tell you how useful this is after so much trouble getting high quality rescaled images. Thanks!


Sign in to add a comment
Powered by Google Project Hosting