: Exporting trimmed layers with their position I'm trying to do some basic stuff. I have a psd file with plenty of layers. Just one of the is the background and all the rest are objects above
I'm trying to do some basic stuff. I have a psd file with plenty of layers. Just one of the is the background and all the rest are objects above the background (each one separated in one different layer).
I want to export this to files. So I used the 'Export layers to files' option, which worked just fine and trimmed the layers to its boundaries as I wanted. The only problem is that now I have to go layer by layer to check its object absolute position in the background and make a list (I'm using this for programming purposes).
What I'd like to have, which shouldn't be so difficult, is the coordinates of the trimmed layer in the whole background. Is there a way to obtain this programmatically?
Thanks in advance,
MartÃn
More posts by @RJPawlick971
2 Comments
Sorted by latest first Latest Oldest Best
This is a version-dependent answer, because you'll need to be on CS6 or later.
Select a layer
Layer > Copy CSS
Paste to your text editor of choice
Repeat this process for each layer. If you've enough layers, or this is something you're likely to want to do regularly, you can automate this with an action.
This second Method requires Ps CC:
In Ps CC, the Generate function in the File menu, especially when it's used in conjunction with the Adobe Layer Namer panel, automates the export of images and can save time because the images are updated instantly as things change in the PSD.
Ps can also create an Edge Reflow project automatically via File > Generate > Edge Reflow Project. As of this writing, the process remains quite buggy, but once Reflow gets out of "Preview" stage, there may be a very fast workflow available.
I only have the cs4 photoshop scripting reference on hand (freely available from adobe).
The object name for a layer is ArtLayer and there is a property called Bounds which is:
Read-only. An array of coordinates that describes the bounding
rectangle of the ArtLayer.
This might allow you to query the layers and extract the data you need. The trick would be to align this data with the files but if they are named the same as the layers, it would be trivial.
google terms:
photoshop_cs4_vbscript_ref.pdf
photoshop_cs4_scripting_guide.pdf
photoshop_cs4_javascript_ref.pdf
There is probably an Actionscript reference as well. Scripts can be run from within the application, but you can write OS-hosted scripts and still access the objects.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.