Glitch and leaking during -disort

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
kamil
Posts: 9
Joined: 2018-04-26T01:26:37-07:00
Authentication code: 1152

Glitch and leaking during -disort

Post by kamil »

Hello. Still im trying learn some skill to make better mockup images. But today i get trouble with distort . When i tray distort my image i get glitch or leaking on result image.
Input design file
Image
Background image
Image

And merget together after script

Code: Select all

magick "C:\HippoDatabase\imageMaker\mockup\v natural.jpg" ( "C:\HippoDatabase\imageMaker\s3\21000\21814\White.png" -background transparent -resize 2136x3642 -distort Perspective "0,0,0,0 0,2583,0,2583 2136,0,2136,207 2136,2583,2136,2374 " ) -gravity West -geometry +498+0 -composite -quality 98 "C:\HippoDatabase\imageMaker\preview\1.jpg"
And result image
Image
Please look at character "C" and top right corner of gold. Any idea why my result is like that?

other design but same error

Code: Select all

cmd /c  magick "C:\HippoDatabase\imageMaker\mockup\v natural.jpg" ( "C:\HippoDatabase\imageMaker\s3\22000\22581\22581-B-.png" -resize 2136x3642 -distort Perspective "0,0,0,0 0,3642,0,3642 2092,0,2092,293 2092,3642,2092,3349 " ) -gravity West -geometry +498+0 -composite -quality 98 "C:\HippoDatabase\imageMaker\preview\q.jpg"
Image


Any idea why it happens, i misscalculate somethink?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Glitch and leaking during -disort

Post by snibgo »

Your images use pixels to their edges. "-distort" extends the image using virtual pixels, and the default virtual pixels is "edge", so these are repeated. To make the virtual pixels transparent-black, insert "-virtual-pixel None" before "-distort".
snibgo's IM pages: im.snibgo.com
Post Reply