Discussion:
How to pad an image with some white pixels?
Peng Yu
2011-11-20 04:30:26 UTC
Permalink
Hi,

I see -crop that can cut an image. I'm wondering how to expand an
image by padding with some background color (e.g. white) pixels. Could
anybody let me know? Thanks!
--
Regards,
Peng
Fred Weinhaus
2011-11-20 18:49:31 UTC
Permalink
convert image -bordercolor white -border 10 resultimage

or

convert image -background white -gravity center -extent WxH resultimage


see
http://www.imagemagick.org/Usage/crop/#border
http://www.imagemagick.org/Usage/crop/#extent
Post by Peng Yu
I see -crop that can cut an image. I'm wondering how to expand an
image by padding with some background color (e.g. white) pixels. Could
anybody let me know? Thanks!
Continue reading on narkive:
Loading...