Problem with extent and background colour

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
manu_l
Posts: 5
Joined: 2014-10-06T23:50:37-07:00
Authentication code: 6789

Problem with extent and background colour

Post by manu_l »

I have a problem to convert files from tif to jpg. The size of the source pictures are different (81x100, 363x400,...) and it should result square pictures like 100x100, 300x300, 600x600. The transparent background in the tif-files and the extented space should be white. I've tryed this command:

Code: Select all

convert -resize 600x600 -background white -extent 600x600 -gravity center /pictures/10_test/90_00.tif /pictures/10_test/90_00.jpg
The problem is that the extented space is black:

source: 363x400
Image
result: 600x600
Image

IM-Version: 6.2.8


Can anyone help me with that problem?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problem with extent and background colour

Post by snibgo »

v6.2.8 is very old. I suggest you update to the current version.

Then put the operations in the natural order: read an image, process it, write it.

Code: Select all

convert in.tif -resize 600x600 -gravity center -background white -extent 600x600 out.jpg
In v6.2.8, putting "-background white" before "-extent 600x600" might help. I don't have such an old version and can't test it.
snibgo's IM pages: im.snibgo.com
manu_l
Posts: 5
Joined: 2014-10-06T23:50:37-07:00
Authentication code: 6789

Re: Problem with extent and background colour

Post by manu_l »

Thank you for help - I will update the software to v6.8.9 and test it again :-)
manu_l
Posts: 5
Joined: 2014-10-06T23:50:37-07:00
Authentication code: 6789

Re: Problem with extent and background colour

Post by manu_l »

After updating IM it works with the code above perfect! :-)
Post Reply