I'm using the command line tool and I'm trying to use extent to extend the canvas of an image in all directions. Meaning, Top, Left, Right, and Bottom.
Here is my command line text:
convert -verbose -background none -extent 480x500 -limit memory 68 -limit map 68 /location/to/file/bookmark1_6.svg /location/to/file/temp/1379205695_5.png
I've tried this to change the offset of the image as a test: convert -verbose -background none -extent 480x500+250+300 -limit memory 68 -limit map 68 /location/to/file/bookmark1_6.svg /location/to/file/temp/1379205695_5.png
I've also tried adding geometry separate like this:
convert -verbose -background none -geometry +250+300 -extent 480x500 -limit memory 68 -limit map 68 /location/to/file/bookmark1_6.svg /location/to/file/temp/1379205695_5.png
but all these do is extend the bottom of the image. I can't seem to offset the position of the original image, or use extent to add more to the canvas in different directions.
Any suggestions?
extent and image position
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: extent and image position
By default, your image is placed on the "North" side of the extent. You probably want the centre:
Note: the proper place for gravity and extent is after the input image, not before.
Code: Select all
convert in.svg -gravity Center -extent 480x500 out.png
snibgo's IM pages: im.snibgo.com
Re: extent and image position
Thanks for the quick response!
Unfortunately I tried moving the extent and gravity to after the input file like this:
convert -verbose -background none -limit memory 68 -limit map 68 /location/to/file/bookmark1_6.svg -extent 480x500 -gravity Center /location/to/file/temp/1379205695_5.png
and the image is still up top. I even tried it again with geometry with no luck.
Unfortunately I tried moving the extent and gravity to after the input file like this:
convert -verbose -background none -limit memory 68 -limit map 68 /location/to/file/bookmark1_6.svg -extent 480x500 -gravity Center /location/to/file/temp/1379205695_5.png
and the image is still up top. I even tried it again with geometry with no luck.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: extent and image position
"-gravity" has an effect on "-extent", but only if it comes before it in the command. When placed after it, it has no effect.
As a general rule, options should be placed in their "logical" order: read an image, set an option that modifies the action of "extent", do the extent, write the image.
As a general rule, options should be placed in their "logical" order: read an image, set an option that modifies the action of "extent", do the extent, write the image.
snibgo's IM pages: im.snibgo.com