0

I am able to read JPEG format image and can write JPEG format image. I want to do same for PNG format image but i am not getting how to do that.

David
  • 15,894
  • 22
  • 55
  • 66
Farrakh
  • 9
  • 1

1 Answers1

0

It's the same concept as jpeg. One of the "magicks" of the library is that it is largely type independent when writing the code. Try doing it the same way.

If you're attempting to do conversion, maybe try looking here.

Christopher Wirt
  • 1,108
  • 1
  • 10
  • 21
  • String fileName = "storage/sdcard0/aaawatermark/canvas.jpg"; ImageInfo info = new ImageInfo(fileName); MagickImage mainImage = new MagickImage(info); String outFileName = "storage/sdcard0/aaawatermark/canvasaaa.png"; mainImage.setImageFormat("png"); mainImage.setFileName(outFileName); mainImage.writeImage(info); – Farrakh May 06 '14 at 06:43
  • I am doing this to write in png format,but i'm getting nothing. I also tried your given link if i am able to convert it but getting nothing. – Farrakh May 06 '14 at 06:44
  • ImageInfo textImage = new ImageInfo("storage/sdcard0/aaawatermark/image.png"); MagickImage cvTextImage = new MagickImage(textImage); – Farrakh May 06 '14 at 06:56
  • I'm not able to read png image. and also not able to write it. – Farrakh May 06 '14 at 06:57