You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JDK vendor and version: Tried with JDK 16, 13, 10, and 8, all gave same results.
Thumbnailator version: 0.4.14
Notes
I traced it through BicubicResizer to AbstractResizer to Graphics2D#drawImage, eventually calling the native sun.java2d.loops.TransformHelper#Transform:
public native void Transform(MaskBlit output,
SurfaceData src, SurfaceData dst,
Composite comp, Region clip,
AffineTransform itx, int txtype,
int sx1, int sy1, int sx2, int sy2,
int dx1, int dy1, int dx2, int dy2,
int[] edges, int dxoff, int dyoff);
The int txtype parameter is 3, which is the "interpolation type" and I assume is AffineTransformOp.TYPE_BICUBIC (which is 3). If that's right, why isn't bicubic used? I hate this AWT black box where only "hints" are provided.
The text was updated successfully, but these errors were encountered:
@NathanSweet, have you tried using BufferedImage.TYPE_INT_ARGB? I suspect that Java's Graphics2D rendering pipeline may act differently based on the image type that's being used. And yes, as you mentioned the black box nature of this pipeline makes it hard to chase these issues.
Expected behavior
Using
ScalingMode.BICUBIC
and downscaling to 50% I expect the output to be scaled using bicubic filtering.Actual behavior
The scaled image looks poor, like bilinear was used. The expected image is Photoshop's bicubic. The actual image looks like Photoshop's bilinear.
Steps to reproduce the behavior
Code below and this image file: http://n4te.com/x/2546-test.png
Environment
Notes
I traced it through BicubicResizer to AbstractResizer to Graphics2D#drawImage, eventually calling the native sun.java2d.loops.TransformHelper#Transform:
The
int txtype
parameter is3
, which is the "interpolation type" and I assume is AffineTransformOp.TYPE_BICUBIC (which is3
). If that's right, why isn't bicubic used? I hate this AWT black box where only "hints" are provided.The text was updated successfully, but these errors were encountered: