GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
libtiled-java use Image instead of BufferedImage because of some old java trick like:
// Deriving a scaled instance, even if it has the same
// size, somehow makes drawing of the tiles a lot
// faster on various systems (seen on Linux, Windows
// and MacOS X).
img = img.getScaledInstance(
It should not be a performance improvement today: http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html
Java image manipulation is easier and faster with BufferedImage, maybe it should be used as preferred image type?
I welcome your patch, as well as your performance tests. :-)
I realized that my issue description is wrong.
My final goal is to get an opengl texture, not to get the best java2d drawing performance.
Using libtiled-java, a tile image will be pass through several conversions:
I dont know how to improve this process...
@devnewton Well at least in your case you would want to avoid converting to Image and then back into BufferedImage. You should be able to modify libtiled-java to take out the conversion to Image quite easily, right? I don't know whether you can get rid of other steps (I haven't used OpenGL in Java).