Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to build an image ontop of another image

 
Jordan Smith
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
My customer has an interesting demand.
He is a jewelery designer.
He wants that a customer will be able to choose a picture of a jewelery (for example a ring) and the user will write down his name in an input box, and it will generate the jewelery with his name on it.
Please see the attached picture for example.
how can i do it? could it be a JAVA task?


ring1.jpg
[Thumbnail for ring1.jpg]
a ring for example
 
Fred Hamilton
Ranch Hand
Posts: 684
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
odelya yomtov-glick wrote:Hi!
My customer has an interesting demand.
He is a jewelery designer.
He wants that a customer will be able to choose a picture of a jewelery (for example a ring) and the user will write down his name in an input box, and it will generate the jewelery with his name on it.
Please see the attached picture for example.
how can i do it? could it be a JAVA task?




One way is to create a BufferedImage object using the original image. Then you could asociate a graphics context with that BufferedImage object, then by using graphics commands on the context, you will be directly mofifying the buffered image.

Have a look in the BufferedImage class for a method that returns a graphics context.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may have to combine several image processing techniques to achieve this. For starters, here's some code that blends two images into one given the alpha percentage:

And here's how to overlay text on an image: http://radio.javaranch.com/davo/2007/07/20/1184942077153.html One or both of these techniques should be useful.
 
Fred Hamilton
Ranch Hand
Posts: 684
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:You may have to combine several image processing techniques to achieve this. For starters, here's some code that blends two images into one given the alpha percentage:

And here's how to overlay text on an image: http://radio.javaranch.com/davo/2007/07/20/1184942077153.html One or both of these techniques should be useful.


OK, I'm interested. I know you know your stuff, so it's not clear to me why there would be several image processing techniques. You draw the second image on to the graphics context of the first image, making sure that your second image has the correct alpha for transparent background. Am I missing something, or is this just two different ways of describing the same thing?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That comment wasn't so much about the approaches I mentioned - you're right that likely only one of them will be applied. What I meant was that other techniques beside these may have to be used to achieve the effect shown in that image: Note how the right side of the "R" blends into the loop of the ring - no simple text or image overlay can produce that effect.
 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing / AWT.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic