Convert .png to .gif in java 1.5

I have a QR code generated in .png format. I want this file to be converted to .gif format for use on the device. I tried to use the ImageIO class, but gif is not supported in java 1.5, but in java 1.6. There is java 1.5 on our production servers, and is there a way to convert a .png file to .gif using Java 1.5?

+4
source share
2 answers

I would prefer to use some command line conversion tool (like ImageMagick). But if it is impossible or practical in your environment, and if you want to do it in Java, you can try this backport .

Keep in mind that conversion is not trivial, if PNG is true color or has transparency, GIF is more limited.

+2
source

Direct conversion from png to gif is not possible. so first try converting the png format to jpg and try converting jpg to gif format.

0
source

All Articles