reading pgm format

V

vaneric

Hi,
is it possible to read .pgm image format using java?.I tried
ImageIO.read("my.pgm") but this failed.I was told that JAI api can
read pgm format.Can anyone tell me how i can obtain a BufferedImage
out of it?

RenderedImage rendimg=JAI.create("fileload","my.pgm");

but then how do i obtain a BufferedImage from this?
thanks in advance,
eric
 
N

Nanne

Eric,

Try

BufferedImage bufferedImage = new
RenderedImageAdapter(rendimg).getAsBufferedImage();

this will obtain BufferedImage.

--Nanne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top