JavaFx image issues
Hi
I basically need to take a large image (say 3000 x 2000), shrink it down to about 180x180, then save it to file.
My current system:
1) Loads the image as an awt.Image
2) Then convert into BufferedImage
3) Then resize it down, using a Kernal and ConvolveOp so the image doesn't look pixelly.
4) Then save this BufferedImage to file.
But when running program as jar file, it crashes on step 2), as the image is around 3000x2000, I think its a problem with memory.
But using javafx image, I can do...
Image img = new Image(path, 180, 180, false, true);
And it appears to scale it down nicely without pixellating it.
But now that I have this image, I can't write it to file, since its not a BufferedImage (or RenderedImage)
Converting it to one seems very difficult, I know theres a couple of methods, but don't want to use deprecated methods.
I suppose its possible to take screenshot, but this actual image is not displayed in the program, so can't really do that,
unless I made it flash on screen for a moment for screenshot to be taken, which I really don't want to do.
Are there any suggestions I can try, thanks.