Convert PSD with 2 alpha channels to TIFF

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
pepelaz
Posts: 4
Joined: 2018-08-08T02:55:35-07:00
Authentication code: 1152

Convert PSD with 2 alpha channels to TIFF

Post by pepelaz »

Hi All,

I have some input.psd file containing 2 alpha channels within it. This is how it looks when open in Photoshop
https://www.dropbox.com/s/8f2bwcwvwn6jxer/1.png?dl=0
It has 2 alpha channels - Spot1 and Spot2

I use the following command to covert it to tiff:

Code: Select all

magick convert input.psd output.tiff
This is how output.tiff file looks in Photoshop
https://www.dropbox.com/s/nleg9xf3kd295vc/2.png?dl=0

So, it's seen that Spot2 is lost, while Spot1 is merged into CMYK channels.

Is this possible using ImageMagick to convert it so that output file looks in Photoshop indentically to input?
Here is input.psd file
https://www.dropbox.com/s/helsicng6eshb ... t.psd?dl=0

Thanks in advance!

Regards,
Vladimir
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert PSD with 2 alpha channels to TIFF

Post by snibgo »

Currently, IM can recognise and process only one alpha channel.
snibgo's IM pages: im.snibgo.com
pepelaz
Posts: 4
Joined: 2018-08-08T02:55:35-07:00
Authentication code: 1152

Re: Convert PSD with 2 alpha channels to TIFF

Post by pepelaz »

snibgo wrote: 2018-08-08T06:30:48-07:00 Currently, IM can recognise and process only one alpha channel.
Thanks for response. But is there a way to make this one alpha channel to look in Photoshop as separated channel, not merged into CMYK channels?
And will multiple alpha channels will be supported in the future?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert PSD with 2 alpha channels to TIFF

Post by snibgo »

pepelaz wrote:But is there a way to make this one alpha channel to look in Photoshop as separated channel, not merged into CMYK channels?
Well, you can do things like this:

Code: Select all

magick input.psd ( +clone -alpha extract ) -alpha off x.tiff
Then x.tiff contains two images: the coloured background, and "Spot1" in white on a black background.
pepelaz wrote:And will multiple alpha channels will be supported in the future?
I don't know.
snibgo's IM pages: im.snibgo.com
pepelaz
Posts: 4
Joined: 2018-08-08T02:55:35-07:00
Authentication code: 1152

Re: Convert PSD with 2 alpha channels to TIFF

Post by pepelaz »

Well, thanks, indeed it is. After executing this command output tiff contains 2 images, like you describe. But that's not what I need. I don't need multipage tiff, but instead I need one page tiff with alpha as separate channel in open in Photoshop. Can I achieve this using ImageMagick?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert PSD with 2 alpha channels to TIFF

Post by snibgo »

Sorry, I don't use Photoshop.
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: Convert PSD with 2 alpha channels to TIFF

Post by fmw42 »

This will work to get Spot 1 as the only alpha with the background image.

Code: Select all

convert input.psd -profile /Users/fred/images/profiles/sRGB.icc \
\( -clone 0 -alpha extract \) \
-alpha off -compose copy_opacity -composite \
-define tiff:alpha=unspecified result.tif
Your image is CMYK with two alpha channels. If I do it without converting to sRGB, it does show only 1 alpha (Spot 1), but the CMYK is messed up. I do not know how to get the second alpha (Spot 2).

Using IM 6.9.10.9 Q16 Mac OSX with Photoshop CC 2018.

At this time Imagemagick cannot handles more than 1 extra channel (CMYKA or RGBA). Though that may change at some later time. It can handle it internally, but there is no interface, yet, for saving to TIF or PSD or any other format.
pepelaz
Posts: 4
Joined: 2018-08-08T02:55:35-07:00
Authentication code: 1152

Re: Convert PSD with 2 alpha channels to TIFF

Post by pepelaz »

Thanks a lot, this seems to be working!

Actually I'm using Magick.NET library (https://github.com/dlemstra/Magick.NET) to perform such conversion within .NET application. How can I translate with script to .NET code?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PSD with 2 alpha channels to TIFF

Post by fmw42 »

You will have to ask on the Magick.NET forum. I do not use that. I only use the command line. I will move this post that forum.
Post Reply