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!
Asked
Active
Viewed 423 times
-2

KEVINPERCY
- 31
- 5
-
"Didn't work" is not sufficient. What error did you get? Does the JavaXT library support PBM format? Have you checked? – Jim Garrison Oct 02 '16 at 06:37
-
1*".... but I've not been lucky"* - What has luck got to do with it? – Stephen C Oct 02 '16 at 07:01
1 Answers
0
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

Jim Garrison
- 85,615
- 20
- 155
- 190