Bug converting PSD to TIF with alpha

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
theiviaxx
Posts: 11
Joined: 2012-09-11T15:26:23-07:00
Authentication code: 67789

Bug converting PSD to TIF with alpha

Post by theiviaxx » 2019-09-04T14:12:37-07:00

So i have a simple PSD with a single layer and RGBA channels. Running a simple convert should result in an RGBA tiff right? However i just get and RGB tiff, the alpha channel has been lost. I've tried the -define tiff:alpha options and all produce the same result.

Code: Select all

convert input.psd[0] output.tif
input.psd: https://drive.google.com/open?id=1UlSwS ... XzhEWj-NVm

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

Re: Bug converting PSD to TIF with alpha

Post by fmw42 » 2019-09-04T15:00:48-07:00

As far as I know, ImageMagick cannot currently handle extra channels such as your alpha channel in PSD. It only processed background transparency. You could request an enhancement, but I suspect there would like be no guaranteed ETA, since the developers are very busy.

theiviaxx
Posts: 11
Joined: 2012-09-11T15:26:23-07:00
Authentication code: 67789

Re: Bug converting PSD to TIF with alpha

Post by theiviaxx » 2019-09-04T15:50:25-07:00

That's a bummer. Do you know if IM can extract the additional channels at all?

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

Re: Bug converting PSD to TIF with alpha

Post by fmw42 » 2019-09-04T17:52:16-07:00

Not currently from TIFF. IM 7 can deal with extra channels but only in its internal format. This was being worked on for TIFF quite a while ago, but got suspended due to other higher priorities.

User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug converting PSD to TIF with alpha

Post by magick » 2019-09-08T05:56:24-07:00

Adding '[0]' to your input image name returns the PSD composite image. It does not include an alpha channel. Remove the '[0]' and you get the image layer which does include the alpha channel:

Code: Select all

convert input.psd output.tif
identify -verbose output.tif | grep -i Alpha:
Alpha: 1-bit

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

Re: Bug converting PSD to TIF with alpha

Post by fmw42 » 2019-09-08T11:53:22-07:00

magick wrote:
2019-09-08T05:56:24-07:00
Adding '[0]' to your input image name returns the PSD composite image. It does not include an alpha channel. Remove the '[0]' and you get the image layer which does include the alpha channel:

Code: Select all

convert input.psd output.tif
identify -verbose output.tif | grep -i Alpha:
Alpha: 1-bit

The output.tiff has two pages. Both look identical. The first has no alpha channel. The second is not just the alpha channel from the input. It looks like the first page. It does have an alpha channel but that is totally opaque. The alpha channel in the PSD is a diagonal striped gradient with alternating black stripes.

So I do not think this is what the OP wanted.

Here is the verbose information for the output.tif:

Code: Select all

 Format: TIFF (Tagged Image File Format)
  Mime type: image/tiff
  Class: DirectClass
  Geometry: 512x512+0+0
  Resolution: 72x72
  Print size: 7.11111x7.11111
  Units: PixelsPerInch
  Colorspace: sRGB
  Type: Palette
  Base type: TrueColor
  Endianess: LSB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Pixels: 262144
    Red:
      min: 0  (0)
      max: 174 (0.682353)
      mean: 27.1875 (0.106618)
      standard deviation: 50.7177 (0.198893)
      kurtosis: 1.81288
      skewness: 1.70798
      entropy: 0.639824
    Green:
      min: 0  (0)
      max: 157 (0.615686)
      mean: 24.4375 (0.0958333)
      standard deviation: 45.6523 (0.179028)
      kurtosis: 1.86026
      skewness: 1.71801
      entropy: 0.639824
    Blue:
      min: 0  (0)
      max: 217 (0.85098)
      mean: 33.8125 (0.132598)
      standard deviation: 63.1411 (0.247612)
      kurtosis: 1.8471
      skewness: 1.71523
      entropy: 0.639824
  Image statistics:
    Overall:
      min: 0  (0)
      max: 217 (0.85098)
      mean: 28.4792 (0.111683)
      standard deviation: 53.1703 (0.208511)
      kurtosis: 2.41628
      skewness: 1.81044
      entropy: 0.639824
  Colors: 3
  Histogram:
    196608: (  0,  0,  0) #000000 black
     49152: ( 87, 78,108) #574E6C srgb(87,78,108)
     16384: (174,157,217) #AE9DD9 srgb(174,157,217)
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 512x512+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 0 of 2
  Compression: RLE
  Orientation: TopLeft
  Properties:
    date:create: 2019-09-08T18:45:28+00:00
    date:modify: 2019-09-08T18:45:23+00:00
    dc:format: application/vnd.adobe.photoshop
    photoshop:ColorMode: 3
    signature: f73e7c912c7606c8a3f6282dc65d91b2fd22ddfb3a9c833dbe7bc2bd66f0b17d
    tiff:alpha: unspecified
    tiff:endian: lsb
    tiff:photometric: RGB
    tiff:rows-per-strip: 512
    tiff:subfiletype: PAGE
    xmp:CreateDate: 2019-08-09T14:36:38-07:00
    xmp:CreatorTool: Adobe Photoshop CC 2019 (Windows)
    xmp:MetadataDate: 2019-09-04T14:06:23-07:00
    xmp:ModifyDate: 2019-09-04T14:06:23-07:00
    xmpMM:DocumentID: adobe:docid:photoshop:76771224-a382-a345-bfb1-3eed323032f8
    xmpMM:InstanceID: xmp.iid:1859e206-17c5-6744-929a-94a921137f65
    xmpMM:OriginalDocumentID: xmp.did:b2e7b0ba-43d1-4348-8500-108ae3f47a33
  Profiles:
    Profile-8bim: 19066 bytes
    Profile-exif: 306 bytes
    Profile-iptc: 16 bytes
      City[1,90]: 0x00000000: 254700                                        -%
      unknown[2,0]: 
    Profile-xmp: 14776 bytes
  Artifacts:
    filename: output.tif
    verbose: true
  Tainted: False
  Filesize: 1.26501MiB
  Number pixels: 262144
  Pixels per second: 18.4504MB
  User time: 0.040u
  Elapsed time: 0:01.014
  Version: ImageMagick 6.9.10-64 Q16 x86_64 2019-09-08 https://imagemagick.org
Image: input.tif
  Format: TIFF (Tagged Image File Format)
  Mime type: image/tiff
  Class: DirectClass
  Geometry: 512x512+0+0
  Resolution: 72x72
  Print size: 7.11111x7.11111
  Units: PixelsPerInch
  Colorspace: sRGB
  Type: PaletteAlpha
  Base type: TrueColor
  Endianess: LSB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 1-bit
  Channel statistics:
    Pixels: 262144
    Red:
      min: 0  (0)
      max: 174 (0.682353)
      mean: 27.1875 (0.106618)
      standard deviation: 50.7177 (0.198893)
      kurtosis: 1.81288
      skewness: 1.70798
      entropy: 0.639824
    Green:
      min: 0  (0)
      max: 157 (0.615686)
      mean: 24.4375 (0.0958333)
      standard deviation: 45.6523 (0.179028)
      kurtosis: 1.86026
      skewness: 1.71801
      entropy: 0.639824
    Blue:
      min: 0  (0)
      max: 217 (0.85098)
      mean: 33.8125 (0.132598)
      standard deviation: 63.1411 (0.247612)
      kurtosis: 1.8471
      skewness: 1.71523
      entropy: 0.639824
    Alpha:
      min: 255  (1)
      max: 255 (1)
      mean: 255 (1)
      standard deviation: 0 (0)
      kurtosis: 8.192e+51
      skewness: 1e+36
      entropy: 0
  Image statistics:
    Overall:
      min: 0  (0)
      max: 255 (1)
      mean: 85.1094 (0.333762)
      standard deviation: 39.8778 (0.156383)
      kurtosis: -1.24628
      skewness: 0.727926
      entropy: 0.479868
  Colors: 3
  Histogram:
    196608: (  0,  0,  0,255) #000000FF black
     49152: ( 87, 78,108,255) #574E6CFF srgba(87,78,108,1)
     16384: (174,157,217,255) #AE9DD9FF srgba(174,157,217,1)
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Background color: white
  Border color: srgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 512x512+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 1 of 2
  Compression: RLE
  Orientation: TopLeft
  Properties:
    date:create: 2019-09-08T18:45:28+00:00
    date:modify: 2019-09-08T18:45:23+00:00
    dc:format: application/vnd.adobe.photoshop
    label: Layer 1
    photoshop:ColorMode: 3
    signature: a7544974b349fd9d00c56944edfc6323b01e98dde73c0424c6038870d16c5def
    tiff:alpha: unassociated
    tiff:endian: lsb
    tiff:photometric: RGB
    tiff:rows-per-strip: 512
    tiff:subfiletype: PAGE
    xmp:CreateDate: 2019-08-09T14:36:38-07:00
    xmp:CreatorTool: Adobe Photoshop CC 2019 (Windows)
    xmp:MetadataDate: 2019-09-04T14:06:23-07:00
    xmp:ModifyDate: 2019-09-04T14:06:23-07:00
    xmpMM:DocumentID: adobe:docid:photoshop:76771224-a382-a345-bfb1-3eed323032f8
    xmpMM:InstanceID: xmp.iid:1859e206-17c5-6744-929a-94a921137f65
    xmpMM:OriginalDocumentID: xmp.did:b2e7b0ba-43d1-4348-8500-108ae3f47a33
  Profiles:
    Profile-8bim: 19066 bytes
    Profile-exif: 306 bytes
    Profile-iptc: 16 bytes
      City[1,90]: 0x00000000: 254700                                        -%
      unknown[2,0]: 
    Profile-xmp: 14776 bytes
  Artifacts:
    filename: output.tif
    verbose: true
  Tainted: False
  Filesize: 0B
  Number pixels: 262144
  Pixels per second: 1.51011MB
  User time: 0.640u
  Elapsed time: 0:01.173
  Version: ImageMagick 6.9.10-64 Q16 x86_64 2019-09-08 https://imagemagick.org

Post Reply