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!

[489 byte] By [javanewbie404a] at [2007-11-26 17:29:32]
# 1
It depends what you want to do exactly.You can see an example here: http://forum.java.sun.com/thread.jspa?threadID=774978&tstart=360
Rodney_McKaya at 2007-7-8 23:57:29 > top of Java-index,Java Essentials,Java Programming...
# 2
affine transform is faster, or so i hear
mkoryaka at 2007-7-8 23:57:29 > top of Java-index,Java Essentials,Java Programming...
# 3

> 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...

Rodney_McKaya at 2007-7-8 23:57:29 > top of Java-index,Java Essentials,Java Programming...