trim removes transparency

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

trim removes transparency

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: trim removes transparency

Post 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
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: trim removes transparency

Post by glennrp »

A fix has been checked in to SVN (svn revision 4129, IM_6.6.9-2)
mjn
Posts: 17
Joined: 2011-03-31T03:27:41-07:00
Authentication code: 8675308

Re: trim removes transparency

Post by mjn »

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

Re: trim removes transparency

Post 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
simonz
Posts: 1
Joined: 2011-07-04T12:11:16-07:00
Authentication code: 8675308

Re: trim removes transparency

Post 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.
dimiurg
Posts: 1
Joined: 2011-07-30T07:48:03-07:00
Authentication code: 8675308

Re: trim removes transparency

Post by dimiurg »

thanx for the fixing, simonz
Post Reply