Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSaving to PNG broken in anything but the default renderer #80
Comments
|
|
Moved ImageIO-based save functionality to PImage. Resolves #80.
|
Cross-posting from #81: Just a quick update here... It looks like even in JavaFX and JOGL, BufferedImage is still the canonical solution. There might not be a way to avoid using it. |
|
Ah, this is something we need to handle differently in the renderers themselves… i.e. if they're using AWT objects (i.e. JOGL and JavaFX also have their own more efficient ways of handling image objects, our use of AWT in those was just a crutch to get things working quickly; this would provide a pathway for others to build out that improved image support. |
|
Thanks @benfry. I'm sorry could you say more about how JavaFX / JOGL would handle this? Maybe just taking JavaFX first... looking around online, it's not clear how to do this in JavaFX without using the AWT Image classes. I may be missing something obvious though. |
Related to #80, implement FX2D save through SwingFXUtils. This still uses PImageAWT but it looks like BufferedImage is still the canonical solution for FX.
|
Also, if you did want that for FX2D, see #98 |
Nope, not missing anything, sorry for the confusion… For now it's necessary to use However, this way, in the future, when someone wants to/has time to excise AWT from JOGL or JavaFX, that can be done as an independent thing. It's also then clearer in the JFX/GL code bases where AWT is being used, rather than introducing a surprise when a user calls AWT has some weird performance bottlenecks that are avoided by more modern approaches for JavaFX, JOGL (i.e. NEWT or whatever it's called now), and LWJGL. So in an ideal world, those renderers would never touch/initalize AWT. In the real world, I've not had time to maintain all those renderers independently, so we're still relying on AWT for some things around the edges (like image i/o). In a similar fashion, For now, the band-aid of using |
|
Trying to gather all this in-progress discussion: https://github.com/processing/processing4/wiki/Exorcising-AWT |
It looks like the
tiffextension is always appended even if the requested filename ends in.pngwhen usingJAVA2D. Looks related to the recent refactor on AWT related code.