Page 1 of 2

Coffe Mug Wrapping

Posted: 2015-05-31T08:27:44-07:00
by astroanalyst
Can IM be used to create really good life like images wrapped on coffee mugs?

See this example
http://society6.com/product/tiffany-fad ... mug#27=199


Is example done with IM or some other script?

Does anyone have an example of what they've done with cylinder wraps?

Re: Coffe Mug Wrapping

Posted: 2015-05-31T08:45:48-07:00
by snibgo

Re: Coffe Mug Wrapping

Posted: 2015-05-31T08:53:00-07:00
by astroanalyst
these scripts are ok but I was looking for a more realistic look like the link I provided.
In photoshop you would use Multiply mode to bring the light variations through.
This makes it look like the image is actually wrapped around the mug because it dips into shadow near the end of the curve.

Re: Coffe Mug Wrapping

Posted: 2015-05-31T08:59:26-07:00
by snibgo
I would do it in Pov-ray. Lighting, texture, surface reflectivity and so on are then much easier.

Re: Coffe Mug Wrapping

Posted: 2015-05-31T09:08:12-07:00
by astroanalyst
Thank you for the advice.
There site seems to be down at the moment.
Can Pov-Ray be used on the fly ....like on a website to instantly generate images on a mug?

Re: Coffe Mug Wrapping

Posted: 2015-05-31T10:41:15-07:00
by snibgo
I don't know if Pov-ray can be run on a server. Unless your users can upload their own mug photos, you wouldn't want to. Pov-ray can generate the displacement and lighting maps for each mug photo in advance. When a user uploads a pattern or text or whatever, IM can apply those maps.

If the users can upload their own mug photos, you have more difficult problems to solve.

Re: Coffe Mug Wrapping

Posted: 2015-05-31T10:50:58-07:00
by fmw42
astroanalyst wrote:these scripts are ok but I was looking for a more realistic look like the link I provided.
In photoshop you would use Multiply mode to bring the light variations through.
This makes it look like the image is actually wrapped around the mug because it dips into shadow near the end of the curve.
You could add a gradient shading to the overlay pattern before using my cylinderize script.

When I have time, I will look into another blending mode to do the overlay, to see if I can achieve such an effect. But I cannot say when I can get to that. But it is a good idea. Of course, the coffee cup needs the shading to transfer to the pattern.

Re: Coffe Mug Wrapping

Posted: 2015-05-31T16:03:22-07:00
by snibgo
For the lighting, another option is to take values from the mug photo and apply those to the pattern after it is displaced to fit.

First approximation: take the mug values, auto-level, multiply this by the pattern.

For realism, specular reflections (the very shiny ones) should be handled separately because they lighten and desaturate colours.

Re: Coffe Mug Wrapping

Posted: 2015-05-31T16:28:12-07:00
by fmw42
snibgo wrote:For the lighting, another option is to take values from the mug photo and apply those to the pattern after it is displaced to fit.

First approximation: take the mug values, auto-level, multiply this by the pattern.

For realism, specular reflections (the very shiny ones) should be handled separately because they lighten and desaturate colours.

With my script, one can always just output the warped texture, do something like snibo says, then composite the lighting adjusted warped texture with whatever compose method one wants (perhaps multiply or perhaps hardlight) to put it onto the mug.

Re: Coffe Mug Wrapping

Posted: 2015-05-31T18:58:28-07:00
by astroanalyst
I'll have my developer look at your script... thank you!

Re: Coffe Mug Wrapping

Posted: 2015-06-01T09:19:59-07:00
by fmw42
astroanalyst wrote:I'll have my developer look at your script... thank you!
It looks somewhat trivial at quick glance. I will try to test that hypothesis this week and if so, I will make a change to add an option for the compose method.

Re: Coffe Mug Wrapping

Posted: 2015-06-01T15:18:22-07:00
by fmw42
I have updated my script to allow shading from the background image. There is a new argument -c compose, which is the compose method of over (as before) and multiply (new). See the last example on my cylinderize script example page.

Re: Coffe Mug Wrapping

Posted: 2015-06-02T07:25:25-07:00
by astroanalyst
Thank you! I'm sending this to my developer right now to look at... that is very kind of you :)

Re: Coffe Mug Wrapping

Posted: 2015-06-04T09:38:27-07:00
by fmw42
Please respond to my PM on the forum. Thanks. Fred

Re: Coffe Mug Wrapping

Posted: 2015-06-26T19:07:55-07:00
by fmw42
astroanalyst wrote:Thank you! I'm sending this to my developer right now to look at... that is very kind of you :)
I have not heard from you in nearly a month about your evaluation. Please contact me. A license fee is due if you are using this on a commercial web site!