Please raise issue if you know better or alternative ways to convert and process images using Java
io.szjug.ImageConverter7
is enhancement over examples listed below.
It uses only JDK (jpeg, png, bmp, wbmp, and gif),
tif
is supported since Java 9
incl Java 11.
png
to jpg
conversion is relatively easy
http://www.mkyong.com/java/convert-png-to-jpeg-image-file-in-java/
https://www.roseindia.net/java/example/java/swing/ConvertImageToFormats.shtml
https://www.codejava.net/java-se/graphics/convert-image-formats
Some theory:
- https://en.wikipedia.org/wiki/JPEG
Magic numberff d8 ff
- https://en.wikipedia.org/wiki/Portable_Network_Graphics
Magic number89 50 4e 47 0d 0a 1a 0a
- https://en.wikipedia.org/wiki/TIFF
Alternatives to Java 9: