problem with 3Dbox

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
capncrunch9834
Posts: 13
Joined: 2012-06-11T07:39:40-07:00
Authentication code: 13

problem with 3Dbox

Post by capncrunch9834 »

( ImageMagick 6.7.7-6 2012-06-03 Q16 )
I'm not sure where this is going wrong but when I use the 3D Box set example as a windows commandline like this...

Code: Select all

convert -virtual-pixel transparent ( "tmp_spine.jpg" -matte  +distort Perspective  "0,0 -30,20  0,200 -30,179  39.5,200 0,200  39.5,0 0.5,0" ) ( "tmp_front.jpg" -matte  +distort Perspective "0.5,0 0.5,0  0.5,200  0.5,200  150,200 100,156  150,0 100,30" ) -background black -layers merge  +repage  -bordercolor black -border 15x2 "3Dbox.png"
this is the result...

Image

I also tried...

Code: Select all

convert "tmp_spine.jpg" -virtual-pixel background  -background none +distort Perspective "0,0 -40,20  0,199 -40,179  39,199 0,199  39,0 0,0" ( "tmp_front.jpg"  +distort Perspective "0,0 0,0  0,199 0,199  149,199 99,169  149,0 99,30"  ) -background none -layers merge +repage -trim  "3Dbox.png"
and this is the result...

Image

I haven't yet figured out why it is "smeared" at the top & bottom, and not being trimmed. Any help would be appreciated.

Thanks
capncrunch9834
Posts: 13
Joined: 2012-06-11T07:39:40-07:00
Authentication code: 13

Re: problem with 3Dbox

Post by capncrunch9834 »

I should probably clarify that this came directly from the example in the docs at...

http://www.imagemagick.org/Usage/distorts/#box3d

and an edit of the script from this site...

http://www.rubblewebs.co.uk/imagemagick ... example=20


For me, both leave a smear at the top & bottom as I have shown above. What is causing this?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: problem with 3Dbox

Post by fmw42 »

I found the same problem yesterday in my script, 3Dbox, and fixed it. I reported this as a bug and then withdrew it, since the fix was easy. See viewtopic.php?f=3&t=21530. Perhaps I withdrew my bug report prematurely, if you are having similar problems with Anthony's example. You will need to wait to hear from him. I sent him PM about this.

P.S. You can fix this issue the same as I did by moving -virtual-pixel transparent inside each paren just before +distort.
Post Reply