transparency is disappearing in ImageMagick vers. 6.4.1

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
thodberg
Posts: 11
Joined: 2008-01-09T14:56:52-07:00

transparency is disappearing in ImageMagick vers. 6.4.1

Post by thodberg »

If I create 2 files hat.tif and lady.tif with transparency in photoshop and
then use these commands in ImageMagick version 6.4.1:

convert hat.tif newhat.tif
convert lady.tif newlady.tif

then the tranparency is disappeared from these files
and the maks used to create tranparency is now appearing
as an extra channel in photoshops channels palette.
In hat.tif and lady.tif the transparency mask was not present
in channels palette

the test files is found here:
http://dejo.dk/Members/estro/hat.tif
http://dejo.dk/Members/estro/lady.tif
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by magick »

We're getting proper transparency using ImageMagick 6.4.1-6, the current release, however there is memory corruption for lady.tif. It has 6 samples per pixels and we only allocated 5. The problem is fixed in ImageMagick 6.4.1-7 Beta, available sometime tomorrow.
thodberg
Posts: 11
Joined: 2008-01-09T14:56:52-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by thodberg »

First: I have used ImageMagick 6.4.1-6 for Windows for my test.

Second: To reproduce the problem it is neasasearry to open the images in Photoshop
before and after these commands are used:

convert hat.tif newhat.tif
convert lady.tif newlady.tif

and compare the look of the channel palette and layer palette
between hat.tif and newhat.tif
and between lady.tif and newlady.tif
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by magick »

Ok, easy fix. We need to propagate the extra samples type, in this case associated alpha.
thodberg
Posts: 11
Joined: 2008-01-09T14:56:52-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by thodberg »

On this adress you will find screendumps from photoshop:
http://javabog.dk/filer/transparens/

hat_in_layer.jpg is the look of the layers palette in photoshop
As you can see there is two layers, a transparent layer and a
white background layer.
Compare this to newhat_layer.jpg, where there is only one layer
with no transparency. In other words the two original layers have
been flattened into one layer.

hat_in_channel.jpg is the look of the channel palette in photoshop.
As you can see there is 3 channels R, G and B.
Compare this to newhat_channel.jpg, which is the look of the
channel palette, where an extra channel have appeared, that is
similar to the shape of the transparent part of the original image.
thodberg
Posts: 11
Joined: 2008-01-09T14:56:52-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by thodberg »

The problem have been fixed in version 6.4.2
thanks!

Thodberg
thodberg
Posts: 11
Joined: 2008-01-09T14:56:52-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by thodberg »

Under some circonstances, namelig when an image is created (not converted) from IM it is still a problem to maintain transparency:

If this command is done:

convert logo: -transparent "#FFFFFF" x628.tif

then the background #FFFFFF should be tranparent, but in PhotoShop it is still shown as an extra channel (called 'Alpha 1') and no transparency is there.

Please see http://javabog.dk/filer/transparens/im- ... toshop.jpg
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by magick »

Transparency is there, notice the 'extra samples' tag:
> tiffinfo x628.tif
TIFF Directory at offset 0x25cc0 (154816)
Image Width: 640 Image Length: 480
Resolution: 72, 72 (unitless)
Bits/Sample: 8
Compression Scheme: LZW
Photometric Interpretation: RGB color
Extra Samples: 1<unassoc-alpha>
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 3
Planar Configuration: single image plane
DocumentName: x628.tif
Software: ImageMagick 6.4.2 07/15/08 Q16 OpenMP http://www.imagemagick.org
Predictor: horizontal differencing 2 (0x2)
We tried a number of programs and they all could recognize the transparency. Photoshop apparently does not follow the TIFF standard. If you can determine the TIFF incantation that Photoshop requires, let us know.
thodberg
Posts: 11
Joined: 2008-01-09T14:56:52-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by thodberg »

We have tried a some other Adobe products as well and they also cant recognize the transparency as well.
This is a big show-stopper for us.

Could we pay you to get you to look at this?

Also, could you elaborate what you mean by "We need to propagate the extra samples type, in this case associated alpha." and why you can't just do the same when creating an image from scratch when it works when changing a PhotoShop TIFF file?
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

odd transparency behavior in 6.4.2

Post by dognose »

If I change the fill color to red, the background is transparent and the text is red.

If I change the fill color to white, the background is black and the text is transparent!

convert -size 150x150 xc:none -fill "white" -pointsize 50 -draw "text 10,125 'text'" text.gif

convert --version
Version: ImageMagick 6.4.2 07/08/08 Q16 OpenMP http://www.imagemagick.org

Image

edit: im built from srpm on centos x86_64
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by magick »

We're using 6.4.2-3:
and a white on transparent image is created as expected.
jn0101
Posts: 40
Joined: 2007-06-16T01:36:07-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by jn0101 »

magick, please please clarify what you meant by the

'Ok, easy fix. We need to propagate the extra samples type, in this case associated alpha.'

and how to do this also on new images.
What code did you change? What attributes (og whatever?) was too much/missing in the TIFF image to make it Adobe compatible.

Thanks!
shaun

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by shaun »

Hi, i'm having a similar problem, but unfortunatley it's continuing with 6.4.2

I have a psd file with a single layer (no background layer) and transparent. When i convert this file to a tiff, the transparancy becomes black like described in the oriinal post, and the transparancy information is saved in an alpha channel when looking in photoshop. the layer is described in photoshop as being a background layer. when using photoshop to do this (save as tif), i'm getting a tif file with no background layer and a single layer with transparancy (as expected).

to replicate the situation, take the hat.tif file, remove background layer and save as a psd, use convert newhat.psd newhatout.tif and the background should be black and the only layer present should be indicated as a background layer.
jn0101
Posts: 40
Joined: 2007-06-16T01:36:07-07:00

Re: transparency is disappearing in ImageMagick vers. 6.4.1

Post by jn0101 »

I repeat my question:
jn0101 wrote:magick, please please clarify what you meant by the

'Ok, easy fix. We need to propagate the extra samples type, in this case associated alpha.'

and how to do this also on new images.
What code did you change? What attributes (og whatever?) was too much/missing in the TIFF image to make it Adobe compatible.

Thanks!
I suppose you are referring to the line
Extra Samples: 1<unassoc-alpha>
of output of tiffinfo?

As we really really need a way to tell Adobe products about transparent layers - whether Photoshop apparently does follow the TIFF standard or not - I ask you could you please explain a little more about it and perhaps point to the lines of code you changed so we can get someone paid to look into this.

Thank you very much!
Post Reply