Search code examples
javaantialiasingimage-scalingjavax.imageio

Does ImageIO read imply anti-aliased scaling?


I've replaced the Java internal ImageFetcher with an own implementation using ImageIO. Some image renderers of our software, which use these images, now draw anti-aliased scaled images instead of non anti-aliased. The only change is the source of the image, which are now BufferedImages instead of Toolkit-Images.

The question now is, where is the difference? Which property causes the images to scale anti-aliased? I've always thought that the anti-alias key ONLY depends on the graphics I paint on - but this is obviously wrong.

By the way: unfortunately I cannot change the renderers.


Solution

  • Ok, after all there is one important difference: BufferedImages are RenderedImages, ToolkitImages are not. This may cause inconsistent behavior in some cases but doesn't seem to be a Java problem in general.