JDeli can convert EMF to PNG image files.
JDeli can do this in ONE step with the convert method. You can also do this by reading an EMF image and then writing the image as PNG, which is useful if you want to process the image in some way.
Convert any images to PNG from Command Line or another language
java -jar jdeli.jar --convert png "inputFileOrDir" "outputDir"
Single step method to convert from EMF into PNG image file in Java
JDeli.convert(File inFile, File outFile);
JDeli.convert(InputStream inFile, OutputStream outfile, String format);
byte outputData = JDeli.convert(byte inputData, String format);
Depending on the image formats being converted (ie set compression level in Tiff files), JDeli also provides overloaded methods. These can be used to supply conversion options for more control over the conversion process.
Read / Write methods for converting from EMF into PNG image file in Java
1. Read EMF image into Java
BufferedImage image = JDeli.read(imageFile);
EmfDecoder decoder = new EmfDecoder();
BufferedImage image = decoder.read(emfByteData);
2. Process image
3. Write out Java image as PNG
File outputFile = new File("image.png"); JDeli.write(image, "png", outputFile);
PngEncoder encoder = new PngEncoder();