-
Enhancement
-
Resolution: Duplicate
-
P4
-
7u15
-
Windows 7 64bit, JDK 1.7.0_15 64bit, JavaFX 2.2.7 64bit, NetBeans 7.3 64bit
When drawing an image in a GraphicsContext using the drawImage() method to enlarge a small image to a larger canvas, the image is being interpolated (possibly using a bilinear or bicubic algorithm).
But there are times like when rendering color maps (temperature, zooplancton, salinity, etc.) or some geographical data (population concentration, etc.) where we want to have no interpolation at all (ie: use the nearest neighbor algorithm instead) in order to represent accurate data and shapes.
In Java2D, this is possible by setting the appropriate RenderingHints.KEY_RENDERING on the Graphics2D at hand.
Currently on JavaFX's GraphicsContext there is no such way to specify how the image is to be interpolated.
The same applies when shrinking images too.
This could be expanded to support a better form of smoothing for the "smooth" value that is available in both Image and ImageView and that does not seem to work very well currently (at least on Windows).
But there are times like when rendering color maps (temperature, zooplancton, salinity, etc.) or some geographical data (population concentration, etc.) where we want to have no interpolation at all (ie: use the nearest neighbor algorithm instead) in order to represent accurate data and shapes.
In Java2D, this is possible by setting the appropriate RenderingHints.KEY_RENDERING on the Graphics2D at hand.
Currently on JavaFX's GraphicsContext there is no such way to specify how the image is to be interpolated.
The same applies when shrinking images too.
This could be expanded to support a better form of smoothing for the "smooth" value that is available in both Image and ImageView and that does not seem to work very well currently (at least on Windows).
- duplicates
-
JDK-8204060 [Canvas] Add API in GraphicsContext to control image smoothing
- Resolved