2 Replies Latest reply: Feb 5, 2010 8:46 AM by thebestcpu RSS

    Writing to a layer's transparency channel

    thebestcpu Community Member

      I hope this is not an easy question because I searched multiple forums and documentation inside and outside the Adobe site and have not seen a direct answer to this question and how to do it if it is possible. (I am using PS4 by the way and have done scripting)

       

      Can one write to a layer's transparency channel with scripting as opposed to needing a plug-in.

       

      Accessing and moving to another location a layer's transparency channel is pretty straightforward in Photoshop (Apply Image and Calculate commands) as well as the equivalent in scripting.

       

      I also know that one can use "Apply Layer Mask" to multiply in the layer mask with the existing layer's transparency channel.  This is effectively writing to the layer's transparency channel only when the layer's transparency channel is fully opaque.

       

      There are workarounds that involve copying out the layer's transparency channel, bring the layer's transparency channel up to full opacity (thorough a variety of push ups) and then "applying" the desired transparency information back into the layer;s transparency channel.  (And thanks to all the posters that have shared those workarounds).

       

      It would be so much easier if anyone have a way to write to the layer's transparency channel directly with PS and PS scripting without a plugin.  If not, I will go the plug-in route or wait for PS5 (rumored to have this capability).

       

      Thanks in advance

       

      John Wheeler

        • 1. Re: Writing to a layer's transparency channel
          c.pfaffenbichler Community Member

          I’m content to be told differently by someone more knowledgeable, but I think one cannot within the Document Object Model.

          If I understand correctly the whole DOM-Scripting-setup does not actually offer distinctly different ways of manipulating objects in a file than are available to the user of Photoshop as is, but only a different way to control or trigger those functionalities.

          • 2. Re: Writing to a layer's transparency channel
            thebestcpu Community Member

            Thanks c.pfaffenbichler  for your thoughts.  I have come to the same conclusion about what I can do through scripting.

             

            I will settle for a workaround.  The easiest looks like reading out the information in the Layer's Transparency Channel,  using a plugin to set the transparency channel to full opaque and then "Apply" from a Layer Mask to write into that Transparency Channel.  Since this Apply function just multiplies that opacities and the value of the Layer's Transparency Channel has been set back to 1 (100%) if effectively just writes in the Layer Mask.

             

            Only semi-convoluted yet thought I would verify if there were another way through this forum.  I will mark this thread as solved.

             

            There are several plugins out there that do this.  The one I used was from PhotoWiz and the packet of plugins you can download is called PhotoFreebies and the specific plugin filter is named Remove Transparency.

             

            John Wheeler