Hi Joseph,

Sun's JDK (as of version 1.4.1) does not honor the BICUBIC hint.  We
hope to add bicubic interpolation in the Tiger release (1.5).  For now
your best bet is to use the BILINEAR hint.  (RENDER_QUALITY will also
result in bilinear interpolation; using both in conjunction will result
in bilinear too.)

You can certainly use JAI to achieve bicubic filtering... You may wish
to consult the [EMAIL PROTECTED] list for more information.

Thanks,
Chris

Joseph Panico wrote:
Hello,

I'm trying to shrink some photos (mostly jpeg) and maintain a reasonable
balance of performance and quality. Right now, the performance is acceptable
and the quality isn't terrible, but it's not so hot. I'm at the point where
I'm willing to trade a *little* performance for some quality gains.

My current technique is to simply apply a scaling transform through an
AffineTransformOp and fiddle with the various rendering hints. I also use
the ImageIO to save the shrunk image as a jpeg file, and I've played around
with the quality settings on the ImageWriter, but I've discovered that while
it does have a small effect on the final quality, it's not worth the effort.
So the current technique looks like this:

AffineTransform         aScaleTransform =
  AffineTransform.getScaleInstance( aScaleFactor, aScaleFactor);
AffineTransformOp       aScaleOp =
  new AffineTransformOp( aScaleTransform, aRenderingHints );

aScaleOp.filter( sourceImage, destinationBuffer);

My problem is that even if I use the highest quality settings:
VALUE_INTERPOLATION_BICUBIC
VALUE_RENDER_QUALITY

the result still looks fairly aliased, jagged. Gonzalez & Woods (textbook)
suggests that blurring the image a bit before the scaling transform will
clean up a lot of the aliasing. Have people found this to be the case? Or is
it more efficient to seek more exotic forms of interploation?

Are these problems more easily solved using JAI?

Thanks for any pointers.



Joseph Panico
[EMAIL PROTECTED]



_________________________________________________________________
Unlimited Internet access for only $21.95/month.  Try MSN!
http://resourcecenter.msn.com/access/plans/2monthsfree.asp

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
--
Chris Campbell                     408-276-6429
[EMAIL PROTECTED]       x16429
Sun Microsystems, Java 2D          USCA22-212

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to