Wrapping effect using Imagick
Wrapping effect using Imagick
Hey guys,
How can I have this "wrapping" effect using imagemagick?
https://gyazo.com/9ef1dd103b7bc01846fa44e6d8d43d3b
thanks
How can I have this "wrapping" effect using imagemagick?
https://gyazo.com/9ef1dd103b7bc01846fa44e6d8d43d3b
thanks
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Wrapping effect using Imagick
See my pages "Coffee mug" and "Cylinders".
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Wrapping effect using Imagick
If on Unix (Linux, Mac OSX, Windows with Cygwin, Windows 10), see my scripts, cylinderize and cylinderwarp at my link below. You could run these using PHP exec().
Please always provide your IM version and Platform, since syntax may differ.
Please always provide your IM version and Platform, since syntax may differ.
Re: Wrapping effect using Imagick
Hi Snibgo, thanks a lot for your reply. Awesome, exactly what I was looking for!snibgo wrote:See my pages "Coffee mug" and "Cylinders".
Yours is actually a lot better than the example I sent, your lighting setup is SUPERB! ; )
Is it possible to create the displacement map profile on Photoshop (se I could create different maps for many objects), and then import the profile on IM?
My idea is to create the mockup on Photoshop, and the export to IM in separate layers (shadows, displacement maps), so I can have users to create ultra realistic mockups online using IM.
Could you offer your paid service to integrate this feature on my website?
thanks!
Re: Wrapping effect using Imagick
fmw42 wrote:If on Unix (Linux, Mac OSX, Windows with Cygwin, Windows 10), see my scripts, cylinderize and cylinderwarp at my link below. You could run these using PHP exec().
Please always provide your IM version and Platform, since syntax may differ.
Thanks Fred! We are using 3.4.1, with Wordpress hosted at WP Engine. Your scripts collection are impressive!
Had a look at the cylinderwarp, and since I am not technical (small business owner here) I am not sure what you approach differs from Snigbdo. It looks like Snigbd's sources the lighting/ray layer to make the displacement. Is that correct?
thanks!
Re: Wrapping effect using Imagick
alexlsg wrote:Hi Snibgo, thanks a lot for your reply. Awesome, exactly what I was looking for!snibgo wrote:See my pages "Coffee mug" and "Cylinders".
Yours is actually a lot better than the example I sent, your lighting setup is SUPERB! ; )
Is it possible to create the displacement map profile on Photoshop (se I could create different maps for many objects), and then import the profile on IM?
My idea is to create the mockup on Photoshop, and the export to IM in separate layers (shadows, displacement maps), so I can have users to create ultra realistic mockups online using IM.
Could you offer your paid service to integrate this feature on my website?
thanks!
Since it's another topic, I created another thread to discuss on how to have separate layers:
viewtopic.php?f=18&t=30234&p=136111#p136111
thanks
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Wrapping effect using Imagick
I don't do dynamic web sites, or PHP, or Photoshop. Sorry.
No. My "Cylinders" page calculates the displacement map with maths. My "Coffee mug" page uses a 3D ray-tracer to distort the identity map, and the result is a displacement map.alexlsg wrote:It looks like Snigbd's sources the lighting/ray layer to make the displacement. Is that correct?
snibgo's IM pages: im.snibgo.com
Re: Wrapping effect using Imagick
snibgo wrote:I don't do dynamic web sites, or PHP, or Photoshop. Sorry.
No. My "Cylinders" page calculates the displacement map with maths. My "Coffee mug" page uses a 3D ray-tracer to distort the identity map, and the result is a displacement map.alexlsg wrote:It looks like Snigbd's sources the lighting/ray layer to make the displacement. Is that correct?
Thanks Snigbgo,
So your "Coffee mug" would only work with a 3D ray traced rendered image (not with photoshop light layers) right?
Sorry for the newbie question... : )
What is the advantage from using a 3D ray-tracer to make the displacement map, over using a traditional "photoshop like" displacement approach? More realism?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Wrapping effect using Imagick
I show two techniques: one uses maths, the other uses a ray-tracer. Other techniques are possible. For example, you could spend time doing a manual displacement in Photoshop or Gimp or whatever.
Advantage? The ray-tracer technique gives correct results with no effort on my part. The math technique gives nearly-correct results, likewise with no effort.
Advantage? The ray-tracer technique gives correct results with no effort on my part. The math technique gives nearly-correct results, likewise with no effort.
snibgo's IM pages: im.snibgo.com
Re: Wrapping effect using Imagick
Got it.
So assuming I already have done the manual displacement in Photoshop, the simplest approach would be to replicate that on ImageMagick, right?
How can i do that? Exporting a Photoshop raster layer displacement map, and then setting this layer up as "displacement" on ImageMagick? Then when a user adds an artwork, it would interactively be displaced as the example I sent you?
So assuming I already have done the manual displacement in Photoshop, the simplest approach would be to replicate that on ImageMagick, right?
How can i do that? Exporting a Photoshop raster layer displacement map, and then setting this layer up as "displacement" on ImageMagick? Then when a user adds an artwork, it would interactively be displaced as the example I sent you?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Wrapping effect using Imagick
My script cylinderize creates the displacement and lighting images internally and then warps the image onto the background. The cylinderwarp script will take exported displacement maps and arguments from cylinderize and allow you to repeatedly use them to warp the same image onto different backgrounds (all the same shape/size mug). Thus you do it once with cylinderize, then apply many times with cylinderwarp, if appropriate.alexlsg wrote:fmw42 wrote:If on Unix (Linux, Mac OSX, Windows with Cygwin, Windows 10), see my scripts, cylinderize and cylinderwarp at my link below. You could run these using PHP exec().
Please always provide your IM version and Platform, since syntax may differ.
Thanks Fred! We are using 3.4.1, with Wordpress hosted at WP Engine. Your scripts collection are impressive!
Had a look at the cylinderwarp, and since I am not technical (small business owner here) I am not sure what you approach differs from Snigbdo. It looks like Snigbd's sources the lighting/ray layer to make the displacement. Is that correct?
thanks!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Wrapping effect using Imagick
In principle, sure. For example, take an identity absolute displacement map, distort that in Photoshop or anything you like, and the result is a displacement map.alexlsg wrote:How can i do that? Exporting a Photoshop raster layer displacement map, and then setting this layer up as "displacement" on ImageMagick?
Here is an identity absolute displacement map (Windows BAT syntax):
Code: Select all
%IM%convert ^
-size 300x200 xc: ^
-sparse-color bilinear ^
0,0,#000,^
%%[fx:w-1],0,#f00,^
0,%%[fx:h-1],#0f0,^
%%[fx:w-1],%%[fx:h-1],#ff0 ^
idDispMap.png
It can be any size you want, provided the corners are black, red, red, yellow and lime, clockwise from top-left.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Wrapping effect using Imagick
Is that green or properly green1 or lime, if you mean IM colornames, e.g. rgb(0,255,0)?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Wrapping effect using Imagick
Well spotted, Fred. I mean #0f0, aka green1 aka lime. I've corrected my post.
The rule is: the red channel increase from left to right, while the green channel increases from top to bottom.
The rule is: the red channel increase from left to right, while the green channel increases from top to bottom.
snibgo's IM pages: im.snibgo.com
Re: Wrapping effect using Imagick
Hey guys, I just tried to create an absolute displacement map:
1- The goal is to replicate this label wrapping i did in Photoshop
https://gyazo.com/6a5ec4c21719c027e7ed96b896249c88
2- So I replaced the label (smart object) with this absolute displacement map
https://gyazo.com/97bffa36bcb409ec6d84c9083f832e92
- Then I applied the same deform as the one the label had
https://gyazo.com/e0dc2fb548d375ec7db6cbdc0d05233d
Is this method of creating the map correct?
1- The goal is to replicate this label wrapping i did in Photoshop
https://gyazo.com/6a5ec4c21719c027e7ed96b896249c88
2- So I replaced the label (smart object) with this absolute displacement map
https://gyazo.com/97bffa36bcb409ec6d84c9083f832e92
- Then I applied the same deform as the one the label had
https://gyazo.com/e0dc2fb548d375ec7db6cbdc0d05233d
Is this method of creating the map correct?