Create a multi-layer tiff

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?".
Post Reply
draker2k2

Create a multi-layer tiff

Post by draker2k2 »

Hello I'm new with this tool :P

I have been trying to create a image with multiple layers to open it in photoshop to see the ones i want just hidding or not one of the specific layer. But i cant create a image with multiple layers.

I have many bmp files, so I want for example get the files number 4 , 5 and 6 in the same image but in diferent layers , so when i open this new one I can hide the layer of the image 4 and 5 and just see the 6th one, or any other combination.

The most i have got have been create a image with multiple alpha channels but i need it to be layers.

I have used the "convert" order and "composite" one too.

I hope u can help me :P

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

Re: Create a multi-layer tiff

Post by fmw42 »

draker2k2 wrote:Hello I'm new with this tool :P

I have been trying to create a image with multiple layers to open it in photoshop to see the ones i want just hidding or not one of the specific layer. But i cant create a image with multiple layers.

I have many bmp files, so I want for example get the files number 4 , 5 and 6 in the same image but in diferent layers , so when i open this new one I can hide the layer of the image 4 and 5 and just see the 6th one, or any other combination.

The most i have got have been create a image with multiple alpha channels but i need it to be layers.

I have used the "convert" order and "composite" one too.

I hope u can help me :P

Thx!!
I am not an expert on this topic and will defer to others, but I really don't think IM supports layers in the Photoshop sense, except to extract layers from a PSD file.

Can you provide a muli-layer TIFF that opens the way you want in Photoshop.

In IM you can create multi-frame Tiff files, but I really don't know about multi-layers as Photoshop handles them.

Anyone else know for sure and can correct me?
draker2k2

Re: Create a multi-layer tiff

Post by draker2k2 »

The multi-layer imagen is not needed to be exactly a TIFF can be a PSD of course.

I though I could use the -page or -layer commands but no one of these works for me or at least I dont know how to make them work as I want.

If It's possible to make it in PSD would be great too :P

Just need a image format that I can open in Photoshop.

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

Re: Create a multi-layer tiff

Post by fmw42 »

draker2k2 wrote:The multi-layer imagen is not needed to be exactly a TIFF can be a PSD of course.

I though I could use the -page or -layer commands but no one of these works for me or at least I dont know how to make them work as I want.

If It's possible to make it in PSD would be great too :P

Just need a image format that I can open in Photoshop.

Thx.
Again, I will defer to the IM experts, but I don't think IM can create a multi-layer PSD file. It can read the layers in an existing image and convert them to separate images, but I don't think IM can create multi-layer images, even as PSD, in the Photoshop sense. It can only make multi-frame images, which I don't believe are the same as Photoshop layers.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Create a multi-layer tiff

Post by magick »

Imagemagikc supports PSD layers when writing, one for each frame in an image sequence. Unfortunately you have little control over the PSD image creation and the resulting image may not be what you want.
Feniksss
Posts: 6
Joined: 2012-04-09T06:36:35-07:00
Authentication code: 8675308

Re: Create a multi-layer tiff

Post by Feniksss »

magick wrote:Imagemagikc supports PSD layers when writing, one for each frame in an image sequence. Unfortunately you have little control over the PSD image creation and the resulting image may not be what you want.

How create PSD with layers???
rich2005
Posts: 32
Joined: 2012-04-09T11:07:36-07:00
Authentication code: 8675308

Re: Create a multi-layer tiff

Post by rich2005 »

You do realise that the previous post was from the end of 2008

However, using IM recently to make multi-layer PS psd files brings up another question which hopefully can be answered.

The switch to use is -adjoin and even this is not really needed as it is assumed by IM so:

convert 1.png 2.png 3.png 4.png -colorspace cmyk filename.psd

Makes a 3 layer psd, for some reason the first layer is thrown away, not a problem, an empty or duplicate layer can be used. Is this normal?

That is fine for cmyk colorspace but there is a colorshift from the RGB png files to CMYK. I have tried to get a RGB PS psd with the same method ( using -colorspace sRGB for example) and all I get are grayscale images. Read a little about this for tiff files and maybe a IM bug?

Is this correct and is there a way to get RGB?

using PCLOS2012 and ImageMagick 6.6.3-4 2011-02-13 Q16
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Create a multi-layer tiff

Post by fmw42 »

This works fine for me in IM 6.7.6.5 Q16 Mac OSX Snow Leopard.

convert rose: rose: rose: -colorspace sRGB 1rose.psd

It is not grayscale.

Note that in IM 6.7.5.5 the meaning of -colorspace RGB and -colorspace sRGB was reversed to properly convey the correct meaning.
rich2005
Posts: 32
Joined: 2012-04-09T11:07:36-07:00
Authentication code: 8675308

Re: Create a multi-layer tiff

Post by rich2005 »

Thanks for the reply, this is just for info and to set the scene

On the above PCLOS linux, that command using rose: did indeed work although I ended up with just 2 layers.
To expand a bit, using 4 200x200 pix layers exported from Inkscape as png's (with transparency) each image about 20 KB
This converted to sizable 6.6 MB psd file which will not open, there is a 'unexpected end of file' error.

I did manage to get on a windows machine with IM 6.7.5 Q16 and got an even larger file 7.1 MB but it does open in PS as RGB. The first layer is still missing. It resaves to a more reasonable 234 KB.

Where did the greyscale come in, from memory, it was using the command without the -colorspace switch.

Perhaps when PCLOS updates IM that will be a solution.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Create a multi-layer tiff

Post by fmw42 »

if you want the first layer in PSD which is usually the flattened result of all the other images, you need to do that separately and then add that to your the beginning of the list of images to be converted to psd

convert image1 image2 image3 image4 \
\( -clone 0-3 -background somecolor -flatten \) \
-insert 0 result.psd

see
http://www.imagemagick.org/Usage/basics/#insert
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/layers/#flatten
Feniksss
Posts: 6
Joined: 2012-04-09T06:36:35-07:00
Authentication code: 8675308

Re: Create a multi-layer tiff

Post by Feniksss »

I create PSD with 5 images(png)
The first four images - color. Fifth image - black and white.

As a result, from black and white image in the layer appears as a blue.

Colorspace don't help...
What's the problem?

Use MagickWand Interface...
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Create a multi-layer tiff

Post by anthony »

I think we need some examples.

MagickWand and command line are actually closely linked, (even closer in IMv7 :-)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Feniksss
Posts: 6
Joined: 2012-04-09T06:36:35-07:00
Authentication code: 8675308

Re: Create a multi-layer tiff

Post by Feniksss »

Also i have question:

Is it possible to named the layers?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Create a multi-layer tiff

Post by fmw42 »

Feniksss wrote:Also i have question:

Is it possible to named the layers?
Not that I know about, since layers in IM are actually just frames and they are simply numbered. However, you may able to comment the layers before you combine them. see -comment. http://www.imagemagick.org/script/comma ... hp#comment That info can then be retrieved from the images verbose info:

However, I will defer to the IM developers to add or correct me.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Create a multi-layer tiff

Post by anthony »

Unless we know how layers are named, I can't help you. We have 'comment' 'label' and 'caption' as posible strings that may be used by the layer handling of the non-IM application.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply