• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to build an image ontop of another image

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Swing / AWT.
 
reply
    Bookmark Topic Watch Topic
  • New Topic