0

I have two images, one base image (background image) and the second is an overlay image. The base image is 180*269 pixels and the overlay image is 1000*2250 pixels.

I have to place the overlay image with specified points. This is almost like virtual dressing i.e you will have a model or girl image and you have to overlay a top or dress on her. We have captured shoulder, waist, hips and thighs x and y coordinates of both images.

example:
Base image - 87,213,244,217,90,435,236,436,82,352,228,352,94,515,230,525

Layered image - 150,111,235,111,149,220,230,223,157,174,227,173,153,265,218,266

Output images needs to be of base image dimensions.

Please help us to merge these images at specified points in Java 2D or jai library.
Give me any reference.

user1920724
  • 21
  • 1
  • 3

1 Answers1

4

See this tutorial:

http://docs.oracle.com/javase/tutorial/2d/images/drawonimage.html

Basically:

  1. create a BufferedImage
  2. call createGraphics on the image to create a Graphics2D object
  3. call drawImage on the graphics object to draw the base image
  4. call drawImage again with the overlay image.
yiding
  • 3,482
  • 18
  • 17