Page 1 of 1
Image gets cut off when arcing after rotating
Posted: 2016-12-16T19:37:26-07:00
by Cosinity
I'm fairly new to ImageMagick, so apologies if the solution to this is incredibly simple.
I'm trying to arc an image upwards using the command line. According to
this page the way to do that is to rotate the image 180 degrees first, then arc it and rotate it back. However when I do that I get the resulting image:
. Rotating or arcing the image alone works fine, as does rotating the image after arcing.
Does anybody have any insight into what is going wrong/how to fix it?
Re: Image gets cut off when arcing after rotating
Posted: 2016-12-16T21:01:35-07:00
by fmw42
What is your input image? What is your IM version and platform, since syntax may differ. Please always provide that.
It does not say to rotate the image all the time. It depends upon what you require for your result and your input image.
This works fine for me on IM 6.9.6.8 Q16 Mac OSX
Code: Select all
convert -font Candice -pointsize 20 label:' Around the World ' -virtual-pixel Background -background SkyBlue -distort Arc 180 arc_circle_3.jpg
Re: Image gets cut off when arcing after rotating
Posted: 2016-12-16T21:07:36-07:00
by Cosinity
I'm running IM 7.0.3 Q16 x64 on Windows 10. I'm using the exact command on the page I linked, with the syntax altered so it works with cmd.exe (and calibri font because I don't have Candice):
Code: Select all
convert -font calibri -pointsize 20 label:"Around the World" -virtual-pixel Background -background SkyBlue -rotate 180 -distort Arc "270 180" arc_flip.jpg
Re: Image gets cut off when arcing after rotating
Posted: 2016-12-16T21:12:02-07:00
by fmw42
If you want the -rotate 180 then add +repage after it. That works fine for me. You have to remove the virtual canvas introduced by the -rotate.
Code: Select all
im7 magick -font Candice -pointsize 20 label:' Around the World ' -rotate 180 +repage -virtual-pixel Background -background SkyBlue -distort Arc "270 180" arc_circle_3.jpg
Re: Image gets cut off when arcing after rotating
Posted: 2016-12-16T21:19:57-07:00
by Cosinity
That last one worked, thank you! I wasn't aware that -rotate added a virtual canvas, knowing that probably would have helped.
Re: Image gets cut off when arcing after rotating
Posted: 2016-12-16T21:21:24-07:00
by fmw42
IM 7 is not as forgiving as IM 6.
Re: Image gets cut off when arcing after rotating
Posted: 2016-12-16T21:23:57-07:00
by fmw42
Any function that changes shape of the input, may add a virtual canvas. Such as -rotate, -trim, -crop, etc. Best to add +repage depending upon your output format and desires and before any subsequent processing. If you do not add it, then if you get odd results, try adding it in.
Re: Image gets cut off when arcing after rotating
Posted: 2016-12-18T19:37:14-07:00
by anthony
Its probably because -rotate switched to using -distort underneath in IM v.6.7.3-4. It probably should do the +repage internally (before and after the internal distort) to ensure it remains a 'simple image warp'. It may be IMv6 got that change but not IMv7.
Actually I just updated the rotate examples to reflect that change (long time to do so) removing the old examples of the problems caused by using 'rotate using 3 shears' (more blury in 'stripes' across image) that it used to use.
http://www.imagemagick.org/Usage/warping/#rotate