extent vs define distort:viewport
Posted: 2017-10-26T09:36:37-07:00
I'm running Version: ImageMagick 7.0.7-8 Q16 x64 2017-10-14 in Powershell 5.1.15063.674 on Windows 10 64-bit
I've noticed strange behaviour when using -extent which I have worked-around using -define distort:viewport. This is the line I use which produces an unwanted result:
And this is the line which produces the wanted result:
Weirdly, if I only run the first line up to the end of "-composite" and save to disk, then load that image and run the rest of the line (i.e. convert output.png -virtual-pixel transparent -extent 3648x5472+523-1200 +repage output.png) then it works just like the second line.
My two questions are, why does the distort viewport option work, but the extent option not; and why does the extent option not work "in-line" but does does work when saved to disk and reloaded?
This example works with a jpeg made like this:
Thanks in advance for any suggestions/answers. Let me know if I should have posted this in bugs!
I've noticed strange behaviour when using -extent which I have worked-around using -define distort:viewport. This is the line I use which produces an unwanted result:
Code: Select all
convert input.jpg `( -clone 0 -gamma 0 -fill white -stroke white -draw "polygon 2347,1536 3648,3789 3648,0 2347,0" `) -alpha off -compose CopyOpacity -composite -virtual-pixel transparent -extent 3648x5472+523-1200 +repage .\output.png
Code: Select all
convert input.JPG `( -clone 0 -gamma 0 -fill white -stroke white -draw "polygon 2347,1536 3648,3789 3648,0 2347,0" `) -alpha off -compose CopyOpacity -composite -virtual-pixel transparent -define distort:viewport=3648x5472+523-1200 -filter point -distort srt 0 +repage .\output.png
My two questions are, why does the distort viewport option work, but the extent option not; and why does the extent option not work "in-line" but does does work when saved to disk and reloaded?
This example works with a jpeg made like this:
Code: Select all
convert -size 3648x5472 xc:red input.jpg