Page 1 of 1

trim removes transparency

Posted: 2011-03-31T03:35:17-07:00
by mjn
The trim command removes the transparency in my image.
This happens with the current version (6.6.9) but also with previous versions (for instance, 6.6.7).
About 12 months ago, this used to work fine.

Here are the command and input and output files:

convert label1.png -trim label2.png

http://dl.dropbox.com/u/219844/label1.png
http://dl.dropbox.com/u/219844/label2.png

Regards, Marcel

Re: trim removes transparency

Posted: 2011-03-31T10:01:10-07:00
by fmw42
I can confirm this also on IM 6.6.9.1 Q16 Mac OSX tiger.

The input is type grayscalematte.

I tried variations also with no success

convert label1.png -trim +repage -type grayscalematte label2.png

convert label1.png -channel rgba -alpha on -trim +repage PNG8:label2.png

convert label1.png -trim +repage PNG32:label2.png

Re: trim removes transparency

Posted: 2011-03-31T11:24:14-07:00
by glennrp
A fix has been checked in to SVN (svn revision 4129, IM_6.6.9-2)

Re: trim removes transparency

Posted: 2011-03-31T15:01:13-07:00
by mjn
Thanks!

Re: trim removes transparency

Posted: 2011-03-31T20:15:13-07:00
by fmw42
Thanks Glenn,

This is working fine now in IM 6.6.9.2 Q16 Mac OSX Tiger

convert label1.png -trim +repage label2.png

Re: trim removes transparency

Posted: 2011-07-04T12:44:05-07:00
by simonz
Hi!

I'm glad I found this thread!

Yesterday I had a hard time to find out why my annotating script wasn't working anymore...
(mostly from http://www.imagemagick.org/Usage/annotating/)

It has a

Code: Select all

mogrify -trim +repage stamp.png
which I found was the problem.

It used to work in IM 6.6.4-1 2010-12-17 Q16 Features: OpenMP (on Fedora 14)
but now it doesn't in 6.6.5-10 2011-02-08 Q16 Features: OpenMP (on Fedora 15)

After some playing around (I'm a beginner with ImageMagick) I found the following workaround:

Code: Select all

mogrify -trim +repage -alpha Background stamp.png
I don't know if that really is appropriate, but at least it let my annotating work again.

Until the fix will reach the distributions that workaround may help other users (who don't want to compile themselves) too.

Re: trim removes transparency

Posted: 2011-07-30T07:51:21-07:00
by dimiurg
thanx for the fixing, simonz