resizing images
I need to resize a lot of BufferedImages
I know that there is a bicubic resize which is fairly fast.
also it seems like i can use AffineTransform
also, i need to perserve size ratio during a resize, and and i dont know if there are any codes out there already which do this without me having to do anything.
can you please advise what is the fastest resizing method for use with BufferedImage and if tools are out there that do this?
THANKS JVERD!
> affine transform is faster, or so i hear
AffineTransform does not scale the image itself.
It is used to transform from image space into user space when drawing the image using drawImage of Graphics2D.
But this is not related to the scaling algorithm used, that can be set using
Graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, ...)
Possible values are:
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
RenderingHints.VALUE_INTERPOLATION_BILINEAR
RenderingHints.VALUE_INTERPOLATION_BICUBIC
Of course VALUE_INTERPOLATION_NEAREST_NEIGHBOR is the fastest but it produces lower quality results...