Saving a TIFF losing alpha channe; in PhotoShop (CS5 and CS6

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.
tafkaks
Posts: 12
Joined: 2012-10-10T06:34:28-07:00
Authentication code: 67789

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by tafkaks »

Ah -- I wonder if just settiing ExtraSamples to 0 would fix this? Any idea how to correct it? There seems to be now way to set this other than tiff:alpha=associated/unassociated
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by fmw42 »

Does EXIFTool allow you to change it? I don't think there is a way in IM.
tafkaks
Posts: 12
Joined: 2012-10-10T06:34:28-07:00
Authentication code: 67789

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by tafkaks »

Unsure -- I'll try when I get a moment and report back
tafkaks
Posts: 12
Joined: 2012-10-10T06:34:28-07:00
Authentication code: 67789

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by tafkaks »

It looks like ExtraSamples is not writeable by exiftool
JK1974
Posts: 5
Joined: 2013-03-22T08:07:21-07:00
Authentication code: 6789

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by JK1974 »

Is there any new solution on this issue or another way to change this ExtraSamples tag to a different value?

I just encountered this problem when I tried to downscale 16 bit negative scans with an additionally alpha channel that stores the infrared channel information (contains all the dust and scratches information). I would prefer imagemagick against Photoshop e.g. because of the advanced scaling algorithms.

I used exiftool to show the tags of both files, and it looked like imagemagick is adding additonal tags as well as removing some of them. This is the command I used:

Code: Select all

convert -compress lzw 01.tif -depth 16 -filter Mitchell -resize x2592 -gravity Center -crop 3872x2592+0+0 +repage 01_new.tif
.
These are all the tags, "+" showing thing that are only in 01.tif and "-" which has been added in 01_new.tif:

Code: Select all

ExifToolVersion                 : 9.23
FileName                        : 01_new.tif
Directory                       : .
FileSize                        : 75 MB
FileModifyDate                  : 2013:03:22 16:54:28+01:00
FileAccessDate                  : 2013:03:22 16:54:26+01:00
FileCreateDate                  : 2013:03:22 16:54:26+01:00
FilePermissions                 : rw-rw-rw-
FileType                        : TIFF
MIMEType                        : image/tiff
ExifByteOrder                   : Little-endian (Intel, II)
+SubfileType                     : Full-resolution Image
ImageWidth                      : 3872
ImageHeight                     : 2592
BitsPerSample                   : 16 16 16 16
Compression                     : LZW
PhotometricInterpretation       : RGB
FillOrder                       : Normal
Make                            : Plustek
Model                           : OpticFilm 7600i
StripOffsets                    : (Binary data 22926 bytes, use -b option to extract)
Orientation                     : Horizontal (normal)
SamplesPerPixel                 : 4
RowsPerStrip                    : 1
StripByteCounts                 : (Binary data 15551 bytes, use -b option to extract)
+MinSampleValue                  : 0 0 0 0
+MaxSampleValue                  : 65535 65535 65535 65535
XResolution                     : 3600
YResolution                     : 3600
PlanarConfiguration             : Chunky
PageName                        : Transparency
ResolutionUnit                  : inches
Software                        : VueScan 9 x64 (9.1.18)
+CreateDate                      : 2013:03:19 20:09:33
ImageSize                       : 3872x2592
-DocumentName                    : 01_new.tif
-PageNumber                      : 0 1
-Predictor                       : Horizontal differencing
-WhitePoint                      : 0.3127000035 0.3289999963
-PrimaryChromaticities           : 0.6399999858 0.3300000132 0.300000012 0.600000024 0.150000006 0.05999999867
-ExtraSamples                    : Unassociated Alpha
I also had the idea of imagemagick removing all tags by setting the -strip switch and using exiftool to adding selected tags from the original file. However, the -strip switch does not seem to work in this case.
JK1974
Posts: 5
Joined: 2013-03-22T08:07:21-07:00
Authentication code: 6789

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by JK1974 »

This is a temporary download address of an original VueScan RAW TIFF output file that does not seem to be converted correctly with ImageMagick: https://dl.dropbox.com/u/17946310/Minol ... FC400-8.7z.
Jayfray
Posts: 1
Joined: 2013-11-21T14:31:21-07:00
Authentication code: 6789

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by Jayfray »

I was able to get ExifTool to edit the ExtraSamples tag by using the .ExifTool_config file.
Here is a sample of the above file.

Code: Select all

%Image::ExifTool::UserDefined = (
	'Image::ExifTool::Exif::Main' => {
        0x0152 => {
            Name => 'ExtraSamples',
            Writable => 'int16u',
            WriteGroup => 'IFD0',
			Count => '1',
        },
)
I set the value to 0 and this did get me the 1st alpha channel to show up but I have 8 in my original file. Any ideas on how to get the other 7 to show up?
If I change the SamplesPerPixel I see more of the alpha channels show in Photoshop but then the image gets skewed and shifted.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Saving a TIFF losing alpha channe; in PhotoShop (CS5 and

Post by fmw42 »

As far as I know, Imagemagick can only handle one alpha channel.
Post Reply