About convert images into one Layered PSD file

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
niha

About convert images into one Layered PSD file

Post by niha »

Hi guys !

Image Magick is capable of make one PSD file from images by :

convert somefile01.gif somefile02.gif blah.gif destination.psd

But the problem is the the destination.psd doesn't seem to keep the images as its layers, I guess the default method is to make images into composite images to make something like an animate gif, but I just want to make a psd file withs layers backed by the images.

I tried to view destination.psd by Photoshop but useless, PS saying something like "There are problem reading layers", view composite image ?"...

If I use some program to parse the destinatioin.psd file into layer images, I noticed that the color of layer images ( except the first layer image ) is not correct ( I set all the Layers with black and white color and I received a green picture of the same sharp of the >= 2nd layers).

Thanks in advance for any advices. I m completely lost :(.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: About convert images to one Layered PSD

Post by fmw42 »

niha wrote:Hi guys !

Image Magick is capable of make one PSD file from images by :

convert somefile01.gif somefile02.gif blah.gif destination.psd

But the problem is the the destination.psd doesn't seem to keep the images as its layers, I guess the default method is to make images into composite images to make something like an animate gif, but I just want to make a psd file withs layers backed by the images.

I tried to view destination.psd by Photoshop but useless, PS saying something like "There are problem reading layers", view composite image ?"...

If I use some program to parse the destinatioin.psd file into layer images, I noticed that the color of layer images ( except the first layer image ) is not correct ( I set all the Layers with black and white color and I received a green picture of the same sharp of the >= 2nd layers).

Thanks in advance for any advices. I m completely lost :(.
There have been several very recent questions lately about making PSD images. See a number of posts by cuongvt a few messages below.

The basic issue that one needs to address is that PSD files have the first layer as the composite of all the other layers. When using IM as above, e.g.

convert image1 image2 image3 ... -adjoin image.psd

all you get is a multi-frame file with each of the images as a "frame". This is not necessarily the same format as PSD expects the data. Furthermore, and I don't know this for a fact, but suspect that PSD may also need some header data to relate its layers. The first issue that must be resolved is that you will need to combine all the input images into one composite image to be supplied as the first image that is used to feed to -adjoin to make the first layer (or frame as IM sees it) of the psd file. I do not know how PS expects this first layer to relate to all the other layers; that is, what IM -compose setting needs to be used to generate the first frame so that it is the way PS expects it. Likewise are there any other issues that need to be worked out regarding the other layers and any header data that PS expects. So somehow you need to do

convert compositeimage image1 image2 image3 ... -adjoin image.psd

How you generate compositeimage from image1 image2 image3 ... is the first issue. It might be as simple as

convert image1 image2 image3 .... -flatten compositeimage

or

convert image1 image2 -composite image3 -composite .... compositeimage

but then again it might need some special -compose setting with each -composite.

I cannot answer this. Perhaps Anthony will be able to shed more light on this issue. My guess is that IM can write a single layer PSD file, but does not do multi-layer files from multiple individual files.
Last edited by fmw42 on 2008-10-30T22:27:14-07:00, edited 1 time in total.
niha

Re: About convert images to one Layered PSD

Post by niha »

fmw42 wrote:
niha wrote:Hi guys !

Image Magick is capable of make one PSD file from images by :

convert somefile01.gif somefile02.gif blah.gif destination.psd

But the problem is the the destination.psd doesn't seem to keep the images as its layers, I guess the default method is to make images into composite images to make something like an animate gif, but I just want to make a psd file withs layers backed by the images.

I tried to view destination.psd by Photoshop but useless, PS saying something like "There are problem reading layers", view composite image ?"...

If I use some program to parse the destinatioin.psd file into layer images, I noticed that the color of layer images ( except the first layer image ) is not correct ( I set all the Layers with black and white color and I received a green picture of the same sharp of the >= 2nd layers).

Thanks in advance for any advices. I m completely lost :(.
There have been several very recent questions lately about making PSD images. See a number of posts by cuongvt a few messages below.

The basic issue that one needs to address is that PSD files have the first layer as the composite of all the other layers. When using IM as above, e.g.

convert image1 image2 image3 ... -adjoin image.psd

All you get is a multi-frame file with each of the images as a "frame". This is not necessarily the same format as PSD expects the data. Furthermore, and I don't know this for a fact, but suspect that PSD may also need some header data to relate its layers. The first issue that must be resolved is that you will need to combine all the input images into one composite image to be supplied as the first image that is used to feed to -adjoin to make the first layer (or frame as IM sees it) of the psd file. I do not know how PS expects this first layer to relate to all the other layers, that is what IM -compose setting needs to be used to generate the first frame so that it is the way PS expects it. Likewise are there any other issues that need to be worked out regarding the other layers and any header data that PS expects. So somehow you need to do

convert compositeimage image1 image2 image3 ... -adjoin image.psd

How you generate compositeimage from image1 image2 image3 ... is the first issue. It might be as simple as

convert image1 image2 image3 .... -flatten compositeimage

or

convert image1 image2 -composite image3 -composite .... compositeimage

but then again it might need some special -compose setting with each -composite.

I cannot answer this. Perhaps Anthony will be able to shed more light on this issue.
First to say, thanks you a lot fmw42, I could see you're one of the most active users in this forums, posted many useful informations to most topic I read. Indead, you lightened up me a bit. I 've been searching informations bout layer related topic in our forums, I read posts by cuongvt too, but unable to found something similiar to what I need.

So basically, I get it as Image MagicK is capable of dealing the problem, but with some hardcore command-line that haven't revealed to the public, maybe I would do some work-around this matter when w8ting Anthony to do some Magick :D,hopefully.

Thanks again fmw42 ( a lot ! ) - Keep up the good work.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: About convert images to one Layered PSD

Post by fmw42 »

niha wrote:
fmw42 wrote:
niha wrote:Hi guys !

Image Magick is capable of make one PSD file from images by :

convert somefile01.gif somefile02.gif blah.gif destination.psd

But the problem is the the destination.psd doesn't seem to keep the images as its layers, I guess the default method is to make images into composite images to make something like an animate gif, but I just want to make a psd file withs layers backed by the images.

I tried to view destination.psd by Photoshop but useless, PS saying something like "There are problem reading layers", view composite image ?"...

If I use some program to parse the destinatioin.psd file into layer images, I noticed that the color of layer images ( except the first layer image ) is not correct ( I set all the Layers with black and white color and I received a green picture of the same sharp of the >= 2nd layers).

Thanks in advance for any advices. I m completely lost :(.
There have been several very recent questions lately about making PSD images. See a number of posts by cuongvt a few messages below.

The basic issue that one needs to address is that PSD files have the first layer as the composite of all the other layers. When using IM as above, e.g.

convert image1 image2 image3 ... -adjoin image.psd

All you get is a multi-frame file with each of the images as a "frame". This is not necessarily the same format as PSD expects the data. Furthermore, and I don't know this for a fact, but suspect that PSD may also need some header data to relate its layers. The first issue that must be resolved is that you will need to combine all the input images into one composite image to be supplied as the first image that is used to feed to -adjoin to make the first layer (or frame as IM sees it) of the psd file. I do not know how PS expects this first layer to relate to all the other layers, that is what IM -compose setting needs to be used to generate the first frame so that it is the way PS expects it. Likewise are there any other issues that need to be worked out regarding the other layers and any header data that PS expects. So somehow you need to do

convert compositeimage image1 image2 image3 ... -adjoin image.psd

How you generate compositeimage from image1 image2 image3 ... is the first issue. It might be as simple as

convert image1 image2 image3 .... -flatten compositeimage

or

convert image1 image2 -composite image3 -composite .... compositeimage

but then again it might need some special -compose setting with each -composite.

I cannot answer this. Perhaps Anthony will be able to shed more light on this issue.
First to say, thanks you a lot fmw42, I could see you're one of the most active users in this forums, posted many useful informations to most topic I read. Indead, you lightened up me a bit. I 've been searching informations bout layer related topic in our forums, I read posts by cuongvt too, but unable to found something similiar to what I need.

So basically, I get it as Image MagicK is capable of dealing the problem, but with some hardcore command-line that haven't revealed to the public, maybe I would do some work-around this matter when w8ting Anthony to do some Magick :D,hopefully.

Thanks again fmw42 ( a lot ! ) - Keep up the good work.
I searched the forum also, but could not find any answer whether IM is capable currently of creating a proper multi-layer PSD file from individual images. Hopefully, when Anthony or Magick get a chance, one of them may be able to shed more light on the subject.

If anyone else has any more information about the PSD multi-layer file format, please chime in or point us to any online information. I found the following using a Google search, but it does not tell me much about how to compose the layers.

http://www.fileformat.info/format/psd/egff.htm
http://designer-info.com/Writing/advanc ... ormats.htm

I also found this old IM forum topic (which may imply there was/is a licensing issue):
viewtopic.php?f=3&t=5685

At this point, the best solution I can think of is to import your multiple IM images into PS and layer them there.
niha

Re: About convert images to one Layered PSD

Post by niha »

fmw42 wrote:
niha wrote:Hi guys !

I searched the forum also, but could not find any answer whether IM is capable currently of creating a proper multi-layer PSD file from individual images. Hopefully, when Anthony or Magick get a chance, one of them may be able to shed more light on the subject.

If anyone else has any more information about the PSD multi-layer file format, please chime in or point us to any online information. I found the following using a Google search, but it does not tell me much about how to compose the layers.

http://www.fileformat.info/format/psd/egff.htm
http://designer-info.com/Writing/advanc ... ormats.htm

I also found this old IM forum topic (which may imply there was/is a licensing issue):
viewtopic.php?f=3&t=5685

At this point, the best solution I can think of is to import your multiple IM images into PS and layer them there.
[/quote]

Yeah, I read the last link, and as MagicK keep saying that, due to the problem of Adobe Licensing Issue, the development of PSD interface inside IM is suspended. That cleared the clouds around the problems, now I got it, thanks fmw42 again, and a lot ( as always :D ). Have a nice day guys.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: About convert images to one Layered PSD

Post by anthony »

The ability of IM to assign 'compose' settings to images is something that has only recently been under consideration.

It is a difficult problem that basically comes down to exactly what -compose does, and how internally 'settings' are stored.

That is should -compose XXXX set the image compose meta-data
(an operator) which can be saved with the output image, or should it only define a global setting which -composite and other alpha composition and image layering operators use?

Basically the question comes down to what the following command should do...

Code: Select all

   convert  -compose DstIn  read_images_with_compose_data.psd \
            -composite  result.png
Should it compose with 'DstIn' or should it compose with whatever compose setting is present in the PSD image?

Also what compose setting should be output in the image meta-data when you do this...

Code: Select all

   convert  image1 image2 image3 \
            -compose DstIn result.psd
or perhaps this...

Code: Select all

   convert  image1 image2 image3 \
            [color=#800000]-set[/color] compose DstIn result.psd
Basically it comes down to the exact meaning of the -compose option in the IM command line interface.

Proposal, This is not how things currently work

My thinking is -compose should remain a setting, whcih defines a global setting that is used by composition operators (-composite, -flatten, -border, -frame, etc etc) and is set overrides any and all compose settings in image meta-data.

If it is not set or unset (using +compose )
then I think IM should then and only then use the images own compose meta-data. This is what happens currently with the color settings (like -background -fill -bordercolor) etc...

I would then have -set compose be the way users can modify an images 'compose' meta-data (as it is currently used for other meta-data settings) which is what is saved with images to files, or used if the global -compose is unset.

-compose should not modify or touch image meta-data compose settings in image read in.

This will in my oppion provide the best of BOTH worlds. simple user control of 'compose' while still allowing, per image, compose controls if people require it.

This also fits other controls.

Well... Except for the settings used to control GIF animation generation, which remains an old style for backward compatibility.
(a global meaning to those setting has little meaning in animation handling) In IM v7 I would recomend that -delay -dispose -loop options be removed in favor of there -set counter parts.


I have added this to a new (plain text) page on ImageMgaick version 7 recomendations Which will appear in a day or so.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: About convert images to one Layered PSD

Post by fmw42 »

anthony wrote:The ability of IM to assign 'compose' settings to images is something that has only recently been under consideration.

It is a difficult problem that basically comes down to exactly what -compose does, and how internally 'settings' are stored.

That is should -compose XXXX set the image compose meta-data
(an operator) which can be saved with the output image, or should it only define a global setting which -composite and other alpha composition and image layering operators use?

Basically the question comes down to what the following command should do...

Code: Select all

   convert  -compose DstIn  read_images_with_compose_data.psd \
            -composite  result.png
Should it compose with 'DstIn' or should it compose with whatever compose setting is present in the PSD image?

Also what compose setting should be output in the image meta-data when you do this...

Code: Select all

   convert  image1 image2 image3 \
            -compose DstIn result.psd
or perhaps this...

Code: Select all

   convert  image1 image2 image3 \
            [color=#800000]-set[/color] compose DstIn result.psd
Basically it comes down to the exact meaning of the -compose option in the IM command line interface.

Proposal, This is not how things currently work

My thinking is -compose should remain a setting, whcih defines a global setting that is used by composition operators (-composite, -flatten, -border, -frame, etc etc) and is set overrides any and all compose settings in image meta-data.

If it is not set or unset (using +compose )
then I think IM should then and only then use the images own compose meta-data. This is what happens currently with the color settings (like -background -fill -bordercolor) etc...

I would then have -set compose be the way users can modify an images 'compose' meta-data (as it is currently used for other meta-data settings) which is what is saved with images to files, or used if the global -compose is unset.

-compose should not modify or touch image meta-data compose settings in image read in.

This will in my oppion provide the best of BOTH worlds. simple user control of 'compose' while still allowing, per image, compose controls if people require it.

This also fits other controls.

Well... Except for the settings used to control GIF animation generation, which remains an old style for backward compatibility.
(a global meaning to those setting has little meaning in animation handling) In IM v7 I would recomend that -delay -dispose -loop options be removed in favor of there -set counter parts.


I have added this to a new (plain text) page on ImageMgaick version 7 recomendations Which will appear in a day or so.
I think the issue here that has been raised is what does PSD expect in the way of -compose and how best to implement that behavior if one can get beyond any licensing issues.
niha

Re: About convert images into one Layered PSD file

Post by niha »

Thanks fmw42 and Anthony, after weeks trying get around with the same problem, I decided to switch my target to a new format : AI ( Adobe Illustrator ArtWork ), I would post a new topic bout the problem. Thanks again for your supports. Topic closed <please> :).
Post Reply