Reputation: 49
I have a QR code generated in .png format. I want this file to be converted into .gif format for using it in a device. I was trying to use ImageIO class but gif is not supported in java 1.5 but in java 1.6 . Our production servers has java 1.5 and is there any way to convert a .png file to .gif using Java 1.5?
Upvotes: 4
Views: 662
Reputation: 1
Direct conversion from png to gif is not possible. so First try to convert png to jpg format and try to convert jpg to gif format.
Upvotes: 0
Reputation: 76016
I'd rather use some command-line conversion tool (eg ImageMagick). But if in your environment that's not possible or practical, and if you want to do it in Java, you can try this backport.
Bear in mind that the conversion is not trivial if the PNG is true colour or has transparency, GIF is more limited.
Upvotes: 2