Interesting that I don't see -size in the options page at http://www.imagemagick.org/script/comma ... ptions.php
If you want to add a border, use either -extent or -border. see http://www.imagemagick.org/script/comma ... ptions.php
But your command is needlessly complicated. I would do it this way
convert mypng.png -resize 480x270\> -gravity center -background none -extent 480x270 resized.png
help resizing a transparent png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: help resizing a transparent png
Last edited by fmw42 on 2009-04-23T09:29:30-07:00, edited 1 time in total.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: help resizing a transparent png
the -size option specifies the size of an image to generate (xc: gradient: plasma: label: etc) or hint at what the final size will be for JPEG.
That last can cause problems if reading in images later afetr creating a canvas image of some kind. It may be a good idea to turn off the size setting (using +size) if you plan to read in other images later. This has caught me out on occasion.
It would be nice in the JPEG size hint was a separate coder setting (typically a -define option) instead of -size
That last can cause problems if reading in images later afetr creating a canvas image of some kind. It may be a good idea to turn off the size setting (using +size) if you plan to read in other images later. This has caught me out on occasion.
It would be nice in the JPEG size hint was a separate coder setting (typically a -define option) instead of -size
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/