Java image manipulation

S

sejong510

I've been looking through Graphics, Graphics2D and can't seem to find
what I need.
I'm looking for a method that takes an image and 4 coordinates that
identify a subset of that image.
But all the methods that I find are restricted to a rectangular shape.

Is there a method that takes in an arbitrary 4-sided shape subset of
the original image and outputs those pixels in a rectangular shape?

i.e. I have a 100x100 image. I want the subset of (0,0),(0,50),
(100,0),(100,25) of the original image to be sampled and outputted to
a new 100x100 image.

Thanks.
 
D

Daniel Pitts

I've been looking through Graphics, Graphics2D and can't seem to find
what I need.
I'm looking for a method that takes an image and 4 coordinates that
identify a subset of that image.
But all the methods that I find are restricted to a rectangular shape.

Is there a method that takes in an arbitrary 4-sided shape subset of
the original image and outputs those pixels in a rectangular shape?

i.e. I have a 100x100 image. I want the subset of (0,0),(0,50),
(100,0),(100,25) of the original image to be sampled and outputted to
a new 100x100 image.

Thanks.
Look at the AffineTransformation class.
 
S

sejong510


Thanks for the response, but in my original post I stated a NON-
rectangular transformation.

Daniel, its almost what I need but unfortunately the coordinates are
not restricted to an affine transformation. A method that would allow
projective transformations would be great.
If anything, I can just go through the image and resize it by assuming
each column is an image 1 x height and stitching it back together.
Was just wondering, if there was a built in method to do this.
 

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,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top