Repage to bigger image gives black background...

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Rule

Repage to bigger image gives black background...

Post by Rule »

Hello,

How can I change the background color for a repage action?
I get black zones where the original image doesn't overlay.
Apparently sometimes it works and sometimes it doesn't...

Thx in advance...


Friendly regards,
Roel
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Repage to bigger image gives black background...

Post by fmw42 »

use -background somecolor -flatten

convert logo: -resize 320x320 -repage 320x320+0+40 -background skyblue -flatten logo_tmp.jpg

but you have to figure out how much to offset. You are better using

convert logo: -resize 320x320 -background skyblue -gravity center -extent 320x320 logo_tmp.jpg

if you want it automatically centered.
Post Reply