Skip to main content
bell10229605
Participating Frequently
April 23, 2019
Answered

Ways to Create Flattened 2-layer PSD Programmatically?

  • April 23, 2019
  • 2 replies
  • 1569 views

Hi, is anyone aware of a programmatic way to create a flattened 2-layer PSD? Happy to provide more context to address the question.

    This topic has been closed for replies.
    Correct answer JJMack

    You are right. I did have that wrong. I rechecked with my team and here is the more complete (and accurate) situation:

    Our team will often begin with a master file PSD which always has more than 2 layers. For instance, there could be a PSD with 10 layers and nine of those layers will have products/images on them while the tenth will have nothing (a white background only). A member of our creative team will usually flatten the nine, non blank layers into one layer such that we end up with a "flattened" two layer PSD. There are thousands of master file PSDs that are formatted this way.

    So the modified request is to figure out if there is a way to script flattening a certain number of layers into one layer while retaining the last blank layer as a second layer.

    If there is a programmatic option for doing this, any guidance on such a solution would be super welcome.


    You are not talking about flattening the creates a single background layer that does not support transparency. What you are describeing is merging some number of layers into a merged  normal raster layer.  The Layers would be composted into a single raster layer document original layer would be in history. And can only be recovered by stepping back in history.

    The Process could be automated if you can describe some logics the can be used to select which layers in a document should be merged. The merge processing may be able to be done via an action or script. Empty layer could also be deleted.  The Document Layer stack will be very different from the saved master document.  Many layers have deleted and a replacement single layer inserter into the layer stack  somewhere above the bottom layer.

    2 replies

    davescm
    Community Expert
    Community Expert
    April 23, 2019

    It definitely needs more description as a "flattened 2- layer" file is contraditory

    Dave

    S_Gans
    Community Expert
    Community Expert
    April 23, 2019

    Yes please, I personally need more clarification as to what you're trying to do.

    Adobe Community Expert / Adobe Certified Instructor
    bell10229605
    Participating Frequently
    April 23, 2019

    Thanks for taking a look at this post!

    I'm looking to automate a manual step for my creative team whenever they retouch an asset. They'll typically pull down a "master file" from Box and then create a flattened 2-layer PSD (with background and without) from that master file. This is currently done for every file in a very large library of PSD files and they wanted to understand if that 2-layer transformation mentioned above could somehow be automated programmatically.

    Let me know if this fills in more of the gaps. And thanks again for looking!

    JJMack
    Community Expert
    Community Expert
    April 24, 2019

    I think you are confused.  A flattened document has only a background layer it does not have additional layer.  Photoshop edits documents not files Photoshop saves documents into files like PSD and other Image file formats..

    Where are the additional layers coming from once you flatten your document?

    'They'll typically pull down a "master file" from Box'????? What do you mean by master file from box?

    JJMack