How is the AffineTransformOp constructed?
What is the result of getInterpolationType()?
new AffineTransformOp (someAffineTransform,
AffineTransformOp.TYPE_BICUBIC).
3.
Believe me, I double-checked *everything* when I noticed lower output
quality than I expected. I eyeballed every line of code dealing with
those particular images ten times, added debugging prints asking
things for their getInterpolationType or other attributes, etc. One
test I ran was to vary the interpolation type; I got worse quality
with TYPE_NEAREST_NEIGHBOR and the exact same with TYPE_BILINEAR which
is made me think it was suddenly acting like Java 4 instead of Java 6.
Of course I threw in System.out.println(System.getProperty
"java.version") once I had that thought, but out popped "1.6.0_24".
In fact, the quality I get (with TYPE_BICUBIC and TYPE_BILINEAR) is
worse than I'd even expect with TYPE_BILINEAR.
Oh, and another thing I tried was using a RenderingHints object
instead of the integer type in the ato's constructor.
KEY_INTERPOLATION, VALUE_INTERPOLATION_BICUBIC of course. When that
had no effect I tried adding KEY_RENDERING, VALUE_RENDER_QUALITY to
that, which didn't change anything either. Meanwhile, using
Graphics.drawImage(img,x,y,w,h,null) instead of
AffineTransformOp.filter (after setting the Graphics's RenderingHints
to the same) results in the quality I get using AffineTransformOp with
TYPE_NEAREST_NEIGHBOR (regardless of the RenderingHints).
Obviously *some* condition has changed. And it is, at least in the
latter case, a "hint" rather than a "guarantee". Is there some
circumstance in which it will fall back on bilinear even when
rendering hints tell it the caller prefers bicubic and prefers quality
over speed? This is an offline render from a BufferedImage to a
BufferedImage with no screen drawing surfaces used.
I suppose I could fall back on Image.getScaledInstance with
SCALE_AREA_AVERAGING, if I don't mind jobs that took seconds taking
minutes and giving only the quality that TYPE_BILINEAR *used* to give
me ...