How to work with layers of PSD in imagick?

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
xlordx
Posts: 4
Joined: 2019-03-10T19:33:31-07:00
Authentication code: 1152

How to work with layers of PSD in imagick?

Post by xlordx » 2019-03-10T19:38:29-07:00

hey guys i want to work with layer from psd file how i can do that with imagick?

greetings

xlordx
Posts: 4
Joined: 2019-03-10T19:33:31-07:00
Authentication code: 1152

Re: How to work with layers of PSD in imagick?

Post by xlordx » 2019-03-19T22:57:13-07:00

no answer?

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

Re: How to work with layers of PSD in imagick?

Post by fmw42 » 2019-03-19T23:02:51-07:00

What kind of layers? What do you want to do with them?

You can extract a layer by referencing it is image sequence number as

convert image.psd[0] image.png

That will extract the first layer which is usually the flattened layer of all the layers in the PSD. Other layers are done similarly. Layers are addressed the same as frames and pages.



Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

xlordx
Posts: 4
Joined: 2019-03-10T19:33:31-07:00
Authentication code: 1152

Re: How to work with layers of PSD in imagick?

Post by xlordx » 2019-03-23T08:08:22-07:00

Hi i want to edit the red text via command for our garden festival

PSD
https://www.xup.in/dl,43045968/LOS.psd/

Image

how i can do that ?

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

Re: How to work with layers of PSD in imagick?

Post by fmw42 » 2019-03-23T09:59:37-07:00

You cannot change text characters in a PSD file in ImageMagick. You might be able to change colors. You can cover over text and then write new text in that area, but you cannot edit text in ImageMagick, the way you would in Photoshop.

Please clarify exactly what you need done.

xlordx
Posts: 4
Joined: 2019-03-10T19:33:31-07:00
Authentication code: 1152

Re: How to work with layers of PSD in imagick?

Post by xlordx » 2019-03-23T17:11:07-07:00

ok thanks for the speedy answers! .. but how can I add the red text in the same position as in the picture above if I would take a copy without the red text, could I then insert the red text at the same height etc.?

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

Re: How to work with layers of PSD in imagick?

Post by fmw42 » 2019-03-23T18:51:00-07:00

If save a version of this PSD file without all the text layers, then you could extract the flattened layer, add new text using the -annotate function and then create a new PSD file (with one layer) or better just save as PNG. The new file would not have editable text as in your original PSD file. In Imagick, see annotateImage for adding text to an image.

You may want to look into processing this PSD file in Photoshop or GIMP, if you want to keep editable text.

Post Reply