IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Java graphics manipulation
Coming up on my weekend project and I need to get some Java code that views and manipulates PBM formatted graphics. Specifically, I need a program where I can merge two long PBM images together (picking the x,y coordinate of the second image to merge into the first).

Any suggestions on Java libraries/routines that would be good starting point for such a project.

Thanks.
New Re: Java graphics manipulation
I don't think the built-in stuff implements PBM, but basically you use ImageIO.read to create a BufferedImage, get the Graphics2D from that image, read in the other image, then use Graphics2D.drawImage to insert the second in the first. ImageIO.write outputs the result.
BufferedImage i1 = ImageIO.read(stream1);\nBufferedImage i2 = ImageIO.read(stream2);\ng2 = i1.getGraphics();\ng2.drawImage(i2, null, x, y);\nImageIO.write(i1, "pbm", outputStream);


Supposedly the JAI Image I/O Tools supports PBM.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Will look into.
Why, oh why, do I always wait till the last minute. :-)
New Cheated.
Did some quick study on the .bmp format and converted the .pbm image to bitmap on the fly. The conversion is mostly automatic though I had to run an XOR (^) on all the bytes because pbm is inverted from bitmap. And, for some stupid reason, the bitmap images are upside down (starting from bottom left).

Anyhow, once in .bmp format, the options are a little more amenable.
     Java graphics manipulation - (ChrisR) - (3)
         Re: Java graphics manipulation - (admin) - (2)
             Will look into. - (ChrisR)
             Cheated. - (ChrisR)

And even if we were to live in that alternate universe where they would be right, they'd still be wrong.
38 ms