Following this tutorial: http://im.snibgo.com/coffmug.htm the final mug image ithat I'm getting is incorrect - upper part of "painted" artwork is distorted. All of the intermediate image files seems to be correct, if compared to one in the article. I've only changed chequer pattern to white floor in cm_scene.pov. I'm using ImageMagick-7.0.7-22.
cm_scene.pov output:
![Image](http://r1me.pl/development/mug/cm_white_mug.png)
Mug mask:
![Image](http://r1me.pl/development/mug/cm_mug_mask.png)
Image mask:
![Image](http://r1me.pl/development/mug/cm_image_mask.png)
Displacement map:
![Image](http://r1me.pl/development/mug/cm_disp_map.png)
cm_i_disp.png
![Image](http://r1me.pl/development/mug/cm_i_disp.png)
Extended displacement map:
![Image](http://r1me.pl/development/mug/cm_extdisp_map.png)
cm_i_extdisp.png:
![Image](http://r1me.pl/development/mug/cm_i_extdisp.png)
Notice single color bar on top. Is this correct?
Script output:
Used artwork file (cm_3.png): http://r1me.pl/development/mug/cm_3.png (1200x400)
Original snibgo logo/text gets distorted too, I've used different artwork file to make distortion more visible.
Code: Select all
call wrapImage ^
cm_3.png ^
cm_white_mug.png ^
cm_extdisp_map.png ^
cm_image_mask.png ^
2 ^
cm_snibgo_mug_im.png
![Image](http://r1me.pl/development/mug/cm_snibgo_mug_im.png)
I'm quite sure the article was written with older version of IM.
IM requires now input and output file for convert operation, but article instructs creation of displacement map image like this:
Code: Select all
%IM%convert ^
-sparse-color Bilinear ^
0,0,#008,^
%%[fx:w-1],0,#f08,^
0,%%[fx:h-1],#0f8,^
%%[fx:w-1],%%[fx:h-1],#ff8 ^
-colorspace RGB ^
cm_i_disp.png
Code: Select all
%IM% convert cm_i_disp_w.png ^
-sparse-color Bilinear ^
0,0,#008,^
1199,0,#f08,^
0,399,#0f8,^
1199,399,#ff8 ^
-colorspace RGB ^
cm_i_disp.png
Are my displacement map files correct? What's causing artwork distortion ?