Can I export a layer from PSD with layer styles attached?
Posted: 2015-07-02T01:14:09-07:00
Say I have a simple PSD file with two layers - a background layer and a text layer.
The background layer is just a normal layer filled with pure white. And the text layer is created by the Horizontal Type Tool. Then I apply a stroke layer effect to the text layer.
I save the file as layer_style.psd. It is the left image in the screenshot below.
When I do
The exported image just looks the same as the PSD file. The stroke around the text stays intact. See the image in the middle of the screenshot below.
However, if I just export the text layer, which is the 2nd layer in my case
The output image only contains the text, no stroke layer style attached. See the image on the right below.(I use the long command above because I want the output file to be the same size as the original PSD file.)
Below is a screenshot of the original PSD file, the exported full image, and the exported text layer image.
So I got 2 assumptions.
1. IM understands Photoshop layer styles because when I export the composite image, the result looks the same as it appears in Photoshop. I'm just not using the right way to export the text layer so I lose the stroke layer style.
2. IM doesn't understand Photoshop layer styles. It is due to the PSD file itself containing a composite image. So when I convert layer_style.psd[0], IM just grabs that information and renders the output file. When I export only the text layer, the stroke layer style is ignored.
Could somebody tell me which one is right?
BTW, I'm working on an online image editor that allows my client to upload a PSD file. If layer style is not supported, I should tell them to rasterize all effects before uploading.
The background layer is just a normal layer filled with pure white. And the text layer is created by the Horizontal Type Tool. Then I apply a stroke layer effect to the text layer.
I save the file as layer_style.psd. It is the left image in the screenshot below.
When I do
Code: Select all
convert layer_style.psd[0] merged.png
However, if I just export the text layer, which is the 2nd layer in my case
Code: Select all
convert layer_style.psd[0] layer_style.psd[2] \( -clone 0 -alpha transparent \) -swap 0 +delete -coalesce -compose src-over -composite text.png
Below is a screenshot of the original PSD file, the exported full image, and the exported text layer image.
So I got 2 assumptions.
1. IM understands Photoshop layer styles because when I export the composite image, the result looks the same as it appears in Photoshop. I'm just not using the right way to export the text layer so I lose the stroke layer style.
2. IM doesn't understand Photoshop layer styles. It is due to the PSD file itself containing a composite image. So when I convert layer_style.psd[0], IM just grabs that information and renders the output file. When I export only the text layer, the stroke layer style is ignored.
Could somebody tell me which one is right?
BTW, I'm working on an online image editor that allows my client to upload a PSD file. If layer style is not supported, I should tell them to rasterize all effects before uploading.