JPG to PBM image conversion

446 views Asked by At

I'm trying to convert a ".jpg" file to ".pbm" in java, but I've not been lucky, I tried with the following code: javaxt.io.Image image = new javaxt.io.Image("image.jpg"); image.saveAs("imagepbm.pbm"); But it didn't work, Could someone help me please! Thanks in advance!

1

There are 1 answers

1
Jim Garrison On

In standard Java 8 PBM format is not supported. The list of supported formats as returned by

    String[] f2 = ImageIO.getWriterFormatNames();
    Arrays.stream(f2).forEach(t -> System.out.println(t));

is:

JPG
jpg
bmp
BMP
gif
GIF
WBMP
png
PNG
wbmp
jpeg
JPEG