Resize image or image transformation like in photoshop
in
Programming Questions
•
11 months ago
Hi guys,
I'm working at something, that I need for work. I'm was never working with the textures before, so I need a hand. I'm trying to map an image (whichever) onto another image. Like a layers in Photoshop. But if you do this in PS, it works with straight lines like a charm.
Example PS: http://www.qcomp.sk/imgcache/116/big/mNX.V7PEC.012_b.jpg
Example Processing: http://www.pcmaster.sk/photo_test.jpg
Code:
My code is actually lot more complex, but this will do. I'll be very glad, if someone can help me with this.
Thanks
I'm working at something, that I need for work. I'm was never working with the textures before, so I need a hand. I'm trying to map an image (whichever) onto another image. Like a layers in Photoshop. But if you do this in PS, it works with straight lines like a charm.
Example PS: http://www.qcomp.sk/imgcache/116/big/mNX.V7PEC.012_b.jpg
Example Processing: http://www.pcmaster.sk/photo_test.jpg
Code:
size(1200, 1000, P3D); textureMode(NORMAL);
PImage under = loadImage("http://www.bilgisayar-destek.com/wp-content/uploads/2012/07/TravelMate-B113-2.jpg");
under.resize(width, height);
PImage img = loadImage("http://images.pcworld.com/images/article/2012/03/windows-8-metro-11329918.jpg");
noStroke();
image(under,0,0);
beginShape(); texture(img);
vertex(498, 62, 0, 0);
vertex(1111, 168, 1, 0);
vertex(1015, 595, 1, 1);
vertex(413, 443, 0, 1);
endShape();
My code is actually lot more complex, but this will do. I'll be very glad, if someone can help me with this.
Thanks
1