PSD and TIFF transparent color vs alpha channel

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

PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

Can anyone explain (or shed some light on) how IM handles/distinquishes PSD (or TIFF) files that have either transparency from a transparent color (in a color table) and/or from an alpha channel.

When I open some files from a client in PS, it show transparency against a checkerboard in either case. The alpha channel case shows up as an alpha channel in PS. However, there does not seem to be any indicator of a transparent color assigned. Yet in some cases, IM detects that and converts it to an alpha channel and in others it misses the transparency all together.

Note: even exiftool shows no indication of any transparency, yet photoshop detects it

Here is a tiff file that PS shows has a transparent color somehow; that is, it has no alpha channel but shows transparency when displayed in Photoshop. IM displays it like shown below (but this is the original tiff).

Original TIFF:
Image

As viewed in PS:
Image


On the other hand, when I open it in IM and look at the verbose info, there is no transparent data what so ever (no alpha values). So it is displayed as in the first image above.

Might IM have a bug in this example image where by it does not detect the transparency data?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PSD and TIFF transparent color vs alpha channel

Post by snibgo »

I think you meant to post the actual image file, but it didn't come through.

(I probably can't help, but you never know.)
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

snibgo wrote:I think you meant to post the actual image file, but it didn't come through.

(I probably can't help, but you never know.)
The first one is the original (hard to tell against a white background, but it has no transparency that IM can detect, yet PS can detect it). Seems to download fine for me. You have to display it in PS to have it show up as in the second image, which was created only to show how PS displays it.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PSD and TIFF transparent color vs alpha channel

Post by snibgo »

False alarm: Firefox apparently can't display tifs.
snibgo's IM pages: im.snibgo.com
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PSD and TIFF transparent color vs alpha channel

Post by snibgo »

Where PS shows chequers, Gimp shows white. I suspect the transparency comes from proprietary (ie "secret") PS data in 8Bim or tag 37724.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

snibgo wrote:Where PS shows chequers, Gimp shows white. I suspect the transparency comes from proprietary (ie "secret") PS data in 8Bim or tag 37724.

I opened all the PSD files in GIMP and they displayed EXACTLY as in PS (with checker background when there is a transparent color assigned, but ignoring the alpha channel). However, the two TIFF files displayed wrong just as in IM.

Somehow GIMP is able to tell about the number of PS channels (including alpha) and transparent colors assigned otherwise, but IM seems to mix the two into an alpha channel if it can find one or the other or both. But my client wants to convert to and save the images as displayed by PS and so disregards the PS alpha and just shows transparency if there is some transparent color defined.

It would be helpful, if IM would store the PS channels (in particular the alpha) in its verbose info and also any transparent assigned color, but I can find no indication of either.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: PSD and TIFF transparent color vs alpha channel

Post by Drarakel »

Regarding the TIFF:
It's probably indeed tag 37724 within the EXIF profile. You could extract it with exiftool (it's "ImageSourceData" there), but it won't help you much... Probably only Photoshop itself can use that proprietary data. But you could test what happens if you delete that tag - the transparency should be gone in PS after that. (Can't test it myself as I don't have Photoshop here.)
I found a short description of "ImageSourceData" (page 11):
http://partners.adobe.com/public/develo ... toshop.pdf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

Drarakel wrote:Regarding the TIFF:
It's probably indeed tag 37724 within the EXIF profile. You could extract it with exiftool (it's "ImageSourceData" there), but it won't help you much... Probably only Photoshop itself can use that proprietary data. But you could test what happens if you delete that tag - the transparency should be gone in PS after that. (Can't test it myself as I don't have Photoshop here.)
I found a short description of "ImageSourceData" (page 11):
http://partners.adobe.com/public/develo ... toshop.pdf

Thanks. I am not an expert on exiftool, but have looked at the data, but it does not list by tag number, at least with my commands, and I cannot see any transparency information in this file.

http://www.fmwconcepts.com/misc_tests/T ... Alphas.tif

I used this command in exiftool and got this back. Does anyone see anything that might indicate transparency?

Code: Select all

exiftool -a -u -g1 TIFFTransparentBackgroundNoAlphas.tif
---- ExifTool ----
ExifTool Version Number         : 8.24
---- System ----
File Name                       : TIFFTransparentBackgroundNoAlphas.tif
Directory                       : .
File Size                       : 37 kB
Resource Fork Size              : 35 kB
File Modification Date/Time     : 2010:07:12 16:22:46-07:00
File Permissions                : rw-r--r--
---- File ----
File Type                       : TIFF
MIME Type                       : image/tiff
Exif Byte Order                 : Big-endian (Motorola, MM)
---- IFD0 ----
Subfile Type                    : Full-resolution Image
Image Width                     : 250
Image Height                    : 250
Bits Per Sample                 : 8 8 8
Compression                     : LZW
Photometric Interpretation      : RGB
Strip Offsets                   : 30296
Orientation                     : Horizontal (normal)
Samples Per Pixel               : 3
Rows Per Strip                  : 250
Strip Byte Counts               : 2086
X Resolution                    : 72
Y Resolution                    : 72
Planar Configuration            : Chunky
Resolution Unit                 : inches
Software                        : Adobe Photoshop CS3 Macintosh
Modify Date                     : 2010:07:12 16:22:38
Predictor                       : Horizontal differencing
Image Source Data               : (Binary data 4984 bytes, use -b option to extract)
---- XMP-x ----
XMP Toolkit                     : Adobe XMP Core 4.1-c036 46.276720, Mon Feb 19 2007 22:13:43
---- XMP-dc ----
Format                          : image/tiff
---- XMP-xmp ----
Creator Tool                    : Adobe Photoshop CS3 Macintosh
Create Date                     : 2010:07:12 16:22:38-07:00
Modify Date                     : 2010:07:12 16:22:38-07:00
Metadata Date                   : 2010:07:12 16:22:38-07:00
---- XMP-xmpMM ----
Document ID                     : uuid:157F5ED68F5711DFB1DBD9AFE133AAC0
Instance ID                     : uuid:050E649A8F6411DFB1DBD9AFE133AAC0
Derived From Instance ID        : uuid:157F5ECF8F5711DFB1DBD9AFE133AAC0
Derived From Document ID        : uuid:157F5ECE8F5711DFB1DBD9AFE133AAC0
---- XMP-tiff ----
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Native Digest                   : 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;6764399F50A86EED8215F857D1AD85D5
Image Width                     : 250
Image Height                    : 250
Bits Per Sample                 : 8, 8, 8
Compression                     : LZW
Photometric Interpretation      : RGB
Samples Per Pixel               : 3
Planar Configuration            : Chunky
---- XMP-exif ----
Exif Image Width                : 250
Exif Image Height               : 250
Color Space                     : sRGB
Native Digest                   : 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;E87F3961C7E882A50CA59192E8642B0E
---- XMP-photoshop ----
Color Mode                      : RGB
ICC Profile Name                : sRGB IEC61966-2.1
History                         : 
---- Photoshop ----
IPTC Digest                     : 00000000000000000000000000000000
XML Data                        : (Binary data 6160 bytes, use -b option to extract)
X Resolution                    : 72
Displayed Units X               : inches
Y Resolution                    : 72
Displayed Units Y               : inches
Print Scale                     : ??
Global Angle                    : 120
Global Altitude                 : 30
Print Flags                     : .
Copyright Flag                  : False
Print Flags Info                : ..
Color Halftoning Info           : /ff.lff../ff.???..2.Z..5.-..
Color Transfer Funcs            : ??????????????????????.???????????????????????.???????????????????????.???????????????????????.?
Layer State Info                : 
Layers Group Info               : 
Photoshop 0x0430                : .
Photoshop 0x042d                : ..
Grid Guides Info                : ..@.@
URL List                        : 
Slices                          : ...null..baseNameTEXT.User.boundsObjc.Rct1.Top longLeftlongBtomlong?Rghtlong?.slicesVlLs.Objc..slice..sliceIDlong.groupIDlong.originenum.ESliceOrigin.autoGeneratedTypeenum.ESliceTypeImg .boundsObjc.Rct1.Top longLeftlongBtomlong?Rghtlong?.urlTEXT.nullTEXT.MsgeTEXT..altTagTEXT..cellTextIsHTMLbool..cellTextTEXT..horzAlignenum.ESliceHorzAlign.default.vertAlignenum.ESliceVertAlign.default.bgColorTypeenum.ESliceBGColorTypeNone.topOutsetlong.leftOutsetlong.bottomOutsetlong.rightOutsetlong
Pixel Aspect Ratio              : .??
IDs Base Value                  : .
Photoshop Thumbnail             : (Binary data 1709 bytes, use -b option to extract)
Version Info                    : ...Adobe Photoshop.Adobe Photoshop CS3.
Photoshop 0x0fa0                : mopt.....????????.????[...]
Photoshop 0x0fa1                : mset...null..Versionlong
Photoshop 0x0fa2                : ms4w.
Photoshop 0x0fa3                : maniIRFR?8BIMAnDs?..null.AFStl[...]
Photoshop 0x0fa4                : mfri....
---- ExifIFD ----
Color Space                     : sRGB
Exif Image Width                : 250
Exif Image Height               : 250
---- ICC-header ----
Profile CMM Type                : Lino
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 1998:02:09 06:49:00
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : IEC
Device Model                    : sRGB
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Media-Relative Colorimetric
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : HP
Profile ID                      : 0
---- ICC_Profile ----
Profile Copyright               : Copyright (c) 1998 Hewlett-Packard Company
Profile Description             : sRGB IEC61966-2.1
Media White Point               : 0.95045 1 1.08905
Media Black Point               : 0 0 0
Red Matrix Column               : 0.43607 0.22249 0.01392
Green Matrix Column             : 0.38515 0.71687 0.09708
Blue Matrix Column              : 0.14307 0.06061 0.7141
Device Mfg Desc                 : IEC http://www.iec.ch
Device Model Desc               : IEC 61966-2.1 Default RGB colour space - sRGB
Viewing Cond Desc               : Reference Viewing Condition in IEC61966-2.1
Luminance                       : 76.03647 80 87.12462
Technology                      : Cathode Ray Tube Display
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
---- ICC-view ----
Viewing Cond Illuminant         : 19.6445 20.3718 16.8089
Viewing Cond Surround           : 3.92889 4.07439 3.36179
Viewing Cond Illuminant Type    : D50
---- ICC-meas ----
Measurement Observer            : CIE 1931
Measurement Backing             : 0 0 0
Measurement Geometry            : Unknown (0)
Measurement Flare               : 0.999%
Measurement Illuminant          : D65
---- Composite ----
Image Size                      : 250x250
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: PSD and TIFF transparent color vs alpha channel

Post by Drarakel »

I used "exiftool -s -ee -g1 -u -n -H" - for a more raw output (-H is for hexadecimal and -D for decimal tag numbers).
"exiftool -b -ImageSourceData TIFFTransparentBackgroundNoAlphas.tif > imagesourcedata.bin" is for extracting the data, and "exiftool -ImageSourceData=" for deleting it. I think, this way you should be able to check if it's really tag 37724/0x935c.
The ImageSourceData in your file is rather small, only 5 KB, but words like "Layer" or "Msk" in it indicate that this could be the place where the transparency is coming from.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

Drarakel wrote:I used "exiftool -s -ee -g1 -u -n -H" - for a more raw output (-H is for hexadecimal and -D for decimal tag numbers).
"exiftool -b -ImageSourceData TIFFTransparentBackgroundNoAlphas.tif > imagesourcedata.bin" is for extracting the data, and "exiftool -ImageSourceData=" for deleting it. I think, this way you should be able to check if it's really tag 37724/0x935c.
The ImageSourceData in your file is rather small, only 5 KB, but words like "Layer" or "Msk" in it indicate that this could be the place where the transparency is coming from.
I tried your suggestion (exiftool -s -ee -g1 -u -n -D), but still don't see any background transparency information. But I don't know the details of this format well enough. Field 37724 is

37724 ImageSourceData : (Binary data 4984 bytes, use -b option to extract)

Code: Select all

exiftool -s -ee -g1 -u -n -D TIFFTransparentBackgroundNoAlphas.tif
---- ExifTool ----
    - ExifToolVersion                 : 8.24
---- System ----
    - FileName                        : TIFFTransparentBackgroundNoAlphas.tif
    - Directory                       : .
    - FileSize                        : 37416
    - ResourceForkSize                : 35558
    - FileModifyDate                  : 2010:07:12 16:22:46-07:00
    - FilePermissions                 : 644
---- File ----
    - FileType                        : TIFF
    - MIMEType                        : image/tiff
    - ExifByteOrder                   : MM
---- IFD0 ----
  254 SubfileType                     : 0
  256 ImageWidth                      : 250
  257 ImageHeight                     : 250
  258 BitsPerSample                   : 8 8 8
  259 Compression                     : 5
  262 PhotometricInterpretation       : 2
  273 StripOffsets                    : 30296
  274 Orientation                     : 1
  277 SamplesPerPixel                 : 3
  278 RowsPerStrip                    : 250
  279 StripByteCounts                 : 2086
  282 XResolution                     : 72
  283 YResolution                     : 72
  284 PlanarConfiguration             : 1
  296 ResolutionUnit                  : 2
  305 Software                        : Adobe Photoshop CS3 Macintosh
  306 ModifyDate                      : 2010:07:12 16:22:38
  317 Predictor                       : 2
37724 ImageSourceData                 : (Binary data 4984 bytes, use -b option to extract)
---- XMP-x ----
    - XMPToolkit                      : Adobe XMP Core 4.1-c036 46.276720, Mon Feb 19 2007 22:13:43
---- XMP-dc ----
    - Format                          : image/tiff
---- XMP-xmp ----
    - CreatorTool                     : Adobe Photoshop CS3 Macintosh
    - CreateDate                      : 2010:07:12 16:22:38-07:00
    - ModifyDate                      : 2010:07:12 16:22:38-07:00
    - MetadataDate                    : 2010:07:12 16:22:38-07:00
---- XMP-xmpMM ----
    - DocumentID                      : uuid:157F5ED68F5711DFB1DBD9AFE133AAC0
    - InstanceID                      : uuid:050E649A8F6411DFB1DBD9AFE133AAC0
    - DerivedFromInstanceID           : uuid:157F5ECF8F5711DFB1DBD9AFE133AAC0
    - DerivedFromDocumentID           : uuid:157F5ECE8F5711DFB1DBD9AFE133AAC0
---- XMP-tiff ----
    - Orientation                     : 1
    - XResolution                     : 72
    - YResolution                     : 72
    - ResolutionUnit                  : 2
    - NativeDigest                    : 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;6764399F50A86EED8215F857D1AD85D5
    - ImageWidth                      : 250
    - ImageHeight                     : 250
    - BitsPerSample                   : 8, 8, 8
    - Compression                     : 5
    - PhotometricInterpretation       : 2
    - SamplesPerPixel                 : 3
    - PlanarConfiguration             : 1
---- XMP-exif ----
    - ExifImageWidth                  : 250
    - ExifImageHeight                 : 250
    - ColorSpace                      : 1
    - NativeDigest                    : 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;E87F3961C7E882A50CA59192E8642B0E
---- XMP-photoshop ----
    - ColorMode                       : 3
    - ICCProfileName                  : sRGB IEC61966-2.1
    - History                         : 
---- Photoshop ----
 1061 IPTCDigest                      : 00000000000000000000000000000000
 1002 XMLData                         : (Binary data 6160 bytes, use -b option to extract)
    0 XResolution                     : 72
    2 DisplayedUnitsX                 : 1
    4 YResolution                     : 72
    6 DisplayedUnitsY                 : 1
 1062 PrintScale                      : ??
 1037 GlobalAngle                     : 120
 1049 GlobalAltitude                  : 30
 1011 PrintFlags                      : .
 1034 CopyrightFlag                   : 0
10000 PrintFlagsInfo                  : ..
 1013 ColorHalftoningInfo             : /ff.lff../ff.???..2.Z..5.-..
 1016 ColorTransferFuncs              : ??????????????????????.???????????????????????.???????????????????????.???????????????????????.?
 1024 LayerStateInfo                  : 
 1026 LayersGroupInfo                 : 
 1072 Photoshop_0x0430                : .
 1069 Photoshop_0x042d                : ..
 1032 GridGuidesInfo                  : ..@.@
 1054 URL_List                        : 
 1050 Slices                          : ...null..baseNameTEXT.User.boundsObjc.Rct1.Top longLeftlongBtomlong?Rghtlong?.slicesVlLs.Objc..slice..sliceIDlong.groupIDlong.originenum.ESliceOrigin.autoGeneratedTypeenum.ESliceTypeImg .boundsObjc.Rct1.Top longLeftlongBtomlong?Rghtlong?.urlTEXT.nullTEXT.MsgeTEXT..altTagTEXT..cellTextIsHTMLbool..cellTextTEXT..horzAlignenum.ESliceHorzAlign.default.vertAlignenum.ESliceVertAlign.default.bgColorTypeenum.ESliceBGColorTypeNone.topOutsetlong.leftOutsetlong.bottomOutsetlong.rightOutsetlong
 1064 PixelAspectRatio                : .??
 1044 IDsBaseValue                    : .
 1036 PhotoshopThumbnail              : (Binary data 1709 bytes, use -b option to extract)
 1057 VersionInfo                     : ...Adobe Photoshop.Adobe Photoshop CS3.
 4000 Photoshop_0x0fa0                : mopt.....????????.????????.????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????.H...TargetSettings.MttCObjc..NativeQuad.Bl  long?Grn long?Rd  long?Trnsbool..addMetadatabool..fileFormatenum.FileFormat.PNG24.interlacedbool.noMatteColorbool.transparencyDitherAlgorithmenum.DitherAlgorithmNone.transparencyDitherAmountlong
 4001 Photoshop_0x0fa1                : mset...null..Versionlong
 4002 Photoshop_0x0fa2                : ms4w.
 4003 Photoshop_0x0fa3                : maniIRFR?8BIMAnDs?..null.AFStlongFrInVlLs.Objc.null.FrIDlongQ)?.FStsVlLs.Objc.null.FsIDlongAFrmlongFsFrVlLs.longQ)?.LCntlong8BIMRoll.
 4004 Photoshop_0x0fa4                : mfri....
---- ExifIFD ----
40961 ColorSpace                      : 1
40962 ExifImageWidth                  : 250
40963 ExifImageHeight                 : 250
---- ICC-header ----
    4 ProfileCMMType                  : Lino
    8 ProfileVersion                  : 528
   12 ProfileClass                    : mntr
   16 ColorSpaceData                  : RGB
   20 ProfileConnectionSpace          : XYZ
   24 ProfileDateTime                 : 1998:02:09 06:49:00
   36 ProfileFileSignature            : acsp
   40 PrimaryPlatform                 : MSFT
   44 CMMFlags                        : 0
   48 DeviceManufacturer              : IEC
   52 DeviceModel                     : sRGB
   56 DeviceAttributes                : 0 0
   64 RenderingIntent                 : 1
   68 ConnectionSpaceIlluminant       : 0.9642 1 0.82491
   80 ProfileCreator                  : HP
   84 ProfileID                       : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
---- ICC_Profile ----
    - ProfileCopyright                : Copyright (c) 1998 Hewlett-Packard Company
    - ProfileDescription              : sRGB IEC61966-2.1
    - MediaWhitePoint                 : 0.95045 1 1.08905
    - MediaBlackPoint                 : 0 0 0
    - RedMatrixColumn                 : 0.43607 0.22249 0.01392
    - GreenMatrixColumn               : 0.38515 0.71687 0.09708
    - BlueMatrixColumn                : 0.14307 0.06061 0.7141
    - DeviceMfgDesc                   : IEC http://www.iec.ch
    - DeviceModelDesc                 : IEC 61966-2.1 Default RGB colour space - sRGB
    - ViewingCondDesc                 : Reference Viewing Condition in IEC61966-2.1
    - Luminance                       : 76.03647 80 87.12462
    - Technology                      : CRT
    - RedTRC                          : (Binary data 2060 bytes, use -b option to extract)
    - GreenTRC                        : (Binary data 2060 bytes, use -b option to extract)
    - BlueTRC                         : (Binary data 2060 bytes, use -b option to extract)
---- ICC-view ----
    8 ViewingCondIlluminant           : 19.6445 20.3718 16.8089
   20 ViewingCondSurround             : 3.92889 4.07439 3.36179
   32 ViewingCondIlluminantType       : 1
---- ICC-meas ----
    8 MeasurementObserver             : 1
   12 MeasurementBacking              : 0 0 0
   24 MeasurementGeometry             : 0
   28 MeasurementFlare                : 0.00999
   32 MeasurementIlluminant           : 2
---- Composite ----
    - ImageSize                       : 250x250
---- RSRC ----
    - CreatorApplication              : Adobe Photoshop CS3

IM sees this image as a gray square surrounded by white (with no alpha data). But Photoshop has it surrounded by transparency (checkerboard).
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: PSD and TIFF transparent color vs alpha channel

Post by Drarakel »

What did you expect? :) ExifTool just lists the tags.
Did you try the other suggestions?
Drarakel wrote:"exiftool -b -ImageSourceData TIFFTransparentBackgroundNoAlphas.tif > imagesourcedata.bin" is for extracting the data, and "exiftool -ImageSourceData=" for deleting it.
I would use "exiftool -ImageSourceData= TIFFTransparentBackgroundNoAlphas.tif" and load the new file into Photoshop in order to see if the transparency was coming from this additional data.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

I would use "exiftool -ImageSourceData= TIFFTransparentBackgroundNoAlphas.tif" and load the new file into Photoshop in order to see if the transparency was coming from this additional data.
Tried that, but PS would not even open the file - said not the right kind of data.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

I created this TIFF file with background transparency (and no alpha layer) in my old PS CS.

Image


To my surprise, IM has an identifier in the verbose info for this transparency:

tiff:alpha: unassociated


Using

exiftool -s -ee -g1 -u -n -D test1.tif

I also see some promising identifiers:

1006 AlphaChannelsNames : .Transparency
1045 UnicodeAlphaNames : .Transparency
1053 AlphaIdentifiers :


But I don't see that particular tiff tag included (tiff:alpha: unassociated), unless that is IM's way to translate these latter tags. But it seems confusing as it talks about alpha and I did not use an alpha layer in PS.

Perhaps in more current PS versions, they have changed transparency identifiers in some way as my old PS CS does not seem capable of making alpha layers.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: PSD and TIFF transparent color vs alpha channel

Post by Drarakel »

For the other users with Firefox or Internet Explorer: :wink:
http://www.fmwconcepts.com/misc_tests/test1.tif

I think, this TIFF has a 'normal' alpha layer - it's a 32bit image..?

I don't use TIFF much, but I believe that TIFFs with alpha layer always have an "ExtraSamples" tag (which should be the tag that ImageMagick displays as 'tiff:alpha'). Your file seems to have "associated" alpha.
ExifTool displays value 1 as "Associated Alpha" and value 2 as "Unassociated Alpha". ImageMagick seems to write value 2 as default - one can change it with "-define", but identify shows it as "unassociated", even when it's "associated" (bug?).
Which was also your conclusion here: viewtopic.php?f=1&t=16443
(But for IM, it probably wouldn't make a difference if it's "associated" or "unassociated".)

I still think that tag "ImageSourceData" is the most probable place for containing transparency if there's no regular alpha layer. ('test1.tiff' has both - an alpha layer and tag "ImageSourceData".) But I don't have Photoshop here - so I can't test these things. I also don't know why PS has problems with the files when the tag is deleted.

Edit: My older IM v6.5.8-5 correctly identifies the ExtraSamples/tiff:alpha value - but not v6.6.3-0. Seems to be a (small) regression.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSD and TIFF transparent color vs alpha channel

Post by fmw42 »

Thanks. I will look over your notes further.

The file test1.tif was created in PS with a background transparency and the inserted the zelda image into it. There was no alpha layer. Thus the unnassociated.
Post Reply