JavaFX ImageView without any smoothing -
is possible render scaled image in imageview in javafx 2.2 without smoothing applied? i'm rendering 50x50 image 200x200 imageview, setsmooth(false), each pixel in source image should map 4x4 square on screen.
however, resulting render still smooths source pixel across 16 destination pixels. know of way without manually copying on each pixel new image?
in javafx 2.2 imageview going smoothing regardless of smooth hint provide imageview.
(based on testing using java 7u15 , windows 7 ati hd4600 graphics card).
perhaps bug imageview smooth image, documentation doesn't specify smoothing or doesn't do, it's hard real intent is. may want post reference question openjfx-dev mailing list or log issue in javafx issue tracker more expert opinion developer.
i tried few different methods scaling image:
- scale in image constructor.
- scale in
imageviewfitwidth/fitheight. - scale using scalex/scaley properties on
imageview. - scale sampling
imagepixelreader , creating new image pixelwriter.
i found methods 1 & 4 resulted in sharp pixelated image wish , 2 & 3 resulted in blurry aliased image.

sample code generate above output.
update ideas on implementing own image filter
a javafx effect not same filter used image loading routines, though effect filter image created. in javafx 2.2 publicly documented api support creation of custom effects, creating of custom effect may prove difficult.
the native code image support open sourced part of openjfx project, @ see how filtering implemented.
you may want file feature request against javafx runtime project "allow make our own 2d filters".
Comments
Post a Comment