14 Replies Latest reply on Jun 15, 2017 5:07 PM by Semaphoric

    Visibility of new channels

    Semaphoric Adobe Community Professional

      I'm working on a project where I am creating a number of Alpha Channels, which will subsequently be combined using Calculations. If I click on the New Channel icon in the Channels panel, I get a visible new channel, but all other channels become hidden. If I select New Channel from the Channels panel menu, the currently visible channels remain visible, but the new channel is hidden. How can I get a visible new channel with all the currently visible channels remaining so?

        • 1. Re: Visibility of new channels
          Chuck Uebele Adobe Community Professional & MVP

          Try this script to create a new, blank channel.

           

          #target photoshop
          var doc = activeDocument;
          doc.channels.add();
          for(var i = 0;i<doc.channels.length;i++){
              doc.channels[i].visible = true;
              }
          
          • 2. Re: Visibility of new channels
            Semaphoric Adobe Community Professional

            Great! Can it be made so "Color indicates Selected Area", rather than Masked Area?

            • 3. Re: Visibility of new channels
              Chuck Uebele Adobe Community Professional & MVP

              I'm not sure. I'll have to look into that. that might be a pref outside of the script.

              • 4. Re: Visibility of new channels
                Chuck Uebele Adobe Community Professional & MVP

                Found it. Here's the new code:

                 

                #target photoshop
                var doc = activeDocument;
                var newChannel = doc.channels.add();
                newChannel.kind= ChannelType.SELECTEDAREA
                for(var i = 0;i<doc.channels.length;i++){
                    doc.channels[i].visible = true;
                    }
                
                1 person found this helpful
                • 5. Re: Visibility of new channels
                  Semaphoric Adobe Community Professional

                  I'll give it a try. I made an Action that runs your first script, and then sets Channel Options, and that works, too.

                  • 6. Re: Visibility of new channels
                    JJMack Most Valuable Participant

                    Semaphoric  wrote

                     

                    I'm working on a project where I am creating a number of Alpha Channels,

                    Be careful about the number of Alpha channels you create.  Delete any you will not use after you combine them.   Photoshop only support up to 53 Alpha channels.  I found that out the hard way my scripts failed when they they tried to create the 54 alpha channel. I had to add code to catch this limit.

                    • 7. Re: Visibility of new channels
                      Semaphoric Adobe Community Professional

                      That's good to know. I remember the old 100 layer limit, which turned out to be artificial. I wonder if 53 Alphas is, too.

                       

                      If needed, I suppose I could just use a second doc to store them.

                      • 8. Re: Visibility of new channels
                        JJMack Most Valuable Participant

                        I found no way around the 53 Alpha channel limit.  I based my Photo Collage Toolkit on my  simple template design. Templates simple to create that would be populated automatically withe the toolkit's scripts. Image were simply mapped by Alpha Channels.  These Alpha channels bounds were used to scale the Placed smart Object image layers transform to size aligned to the alpha  channel and than mask to its shaped.  Everything work great till I tried to create a collage with more than 53 images. I had to note the 53 limit and change the scripts to catch the limit.  The only script capable of more than 53 images in my toolkit is PasteImageroll. It does not use a template it can populate any number of image  and create a document canvas size the selected images will fit in. The image are fitted and masked to a tile size you set.

                         

                        53 Alpha channels is Photoshop's limit....

                        • 9. Re: Visibility of new channels
                          davescm Adobe Community Professional

                          JJMack  wrote

                           

                          I found no way around the 53 Alpha channel limit.

                           

                           

                          I suppose you could work around the limit by converting and storing the additional alpha channels as masks on an empty layer - loading them back in as Alpha when required, or using calculations straight on the masks

                           

                          Dave

                          • 10. Re: Visibility of new channels
                            Chuck Uebele Adobe Community Professional & MVP

                            Or you could store them as different rib channels on multiple layers.

                            • 11. Re: Visibility of new channels
                              JJMack Most Valuable Participant

                              The whole reason for using Alpha channels in the first place was for template simplicity  not have to have layers to hold images or act as clipping mask  all a script has to do is count the number of Image Alpha channels then place in that many image files above the required Background layer.  Any layer in a template above the background layer would be overlay  layers to enhance  the images that will be place by a scripting. These Template psd files are easy to create and populating them is a straight forward scripting task.  The Idea is was not to have a complex template design         To get around Photoshop's Alpha channel limit which I did not know was so low would add complexity I absolutely do not want in template design.  

                              • 12. Re: Visibility of new channels
                                davescm Adobe Community Professional

                                I understand that JJMack, I was not suggesting you did it.

                                It was just me trying to think around the barrier in case anyone else faced it. I was thinking of situations where a group of layers could act as a temporary "store" for excess Alpha channels.

                                 

                                Dave

                                • 13. Re: Visibility of new channels
                                  JJMack Most Valuable Participant

                                  Yes you can have 8000 layers and each layer can havs a Raster  layer Mask whch are channels  like  alpha channel but are only listed/shown in the channel palette when the its layer is the current Photoshop target layer the other are like hidden alpha channels. However, you can only cereate  53 channels with names. So you can have  8000 channels associated with layers but  you can only access them by making the layer they are on the actuve  layer thel load its layer mask channel as a selection.  Each requaries a layer of Group to be on..

                                  • 14. Re: Visibility of new channels
                                    Semaphoric Adobe Community Professional

                                    But like I said, you can store them in another doc, as long as both are open at the same time.