13 Replies Latest reply: May 3, 2012 3:46 AM by Trevor.Dennis RSS

    How do I view two layers alternately

    Mahombi Community Member

      Is there a shortcut for viewing two layers alternately in Photoshop?

       

      For example, I have two different sharpening layers which I would like to compare by switching between them both. Currently I have to turn one off and then the other on, to view the effect of one. Then to view the other one, I have to go through the same procedure. This is a very awkward method.

       

      I'm thinking there must be a method whereby turning one layer on, automatically turns the other one off and clicking again reverses the process.

       

      Can someone enlighten me?

        • 1. Re: How do I view two layers alternately
          c.pfaffenbichler Community Member

          I'm thinking there must be a method whereby turning one layer on, automatically turns the other one off and clicking again reverses the process.

          And what makes you think that?

           

          You may want to look into Screenshots (in the History Panel) and/or Layer Comps and/or Actions.

           

          Edit: Scripting may be another good option and it could handle arbitrary numbers of selected Layers.

          • 2. Re: How do I view two layers alternately
            emil emil Community Member

            I'm guessing that you need a quick switch between two images with subtle differences in order to detect them without looking away during the switch.

            As c.ptaffenbichler suggested, Layer comps can do that if you use one of the arrows at the bottom of the Layer Comps panel with two comps created. Just position the mouse cursor over one of the arrows and  keep clicking it with the desired frequency without looking at it.

            Alternatively with similar effort you can use Ctrl/Cmd + Shift + Alt + E hotkey to create a temporary flatten image layer of the document while displaying one ot the two states. Then set the layers below to display the other state, and you can keep clicking only on the eye of the flat layer without looking there.

            Also you can use Image > Duplicate to create a copy of the image and position the two windows on top of each other, then use Ctrl + Tab  and Ctrl+Shift + Tab if many other windows are open to switch between the two windows and this will animate any subtle differences.

            • 3. Re: How do I view two layers alternately
              R_Kelly Community Member

              Another way if the layers don't effect any layers below such as with blending modes, etc is to Alt (option) click on the eye for the bottom of the two layers and then repeat to alternate the visibilty.

              Another way would be to make a seperate snapshot for each layer and then switch between the snapshots in the history panel.

              Or switch the order of the layers in the layers panel and use Ctrl (cmd)+Z to alternate the view. (this is undo/redo if your using the default undo and step back shortcuts)

              • 4. Re: How do I view two layers alternately
                Mahombi Community Member

                And what makes you think that?

                 

                Well c.pfaffenbichler, mainly blind optimism, coloured by the fact that there's no shortage of shortcuts for other moves. I was hoping there would be, for this one.

                 

                Evidently that isn't the case, but thank you to you, emil emil and R_Kelly for your solutions.

                 


                • 5. Re: How do I view two layers alternately
                  c.pfaffenbichler Community Member

                  In case you ever want to sqwitch through a number of Layers larger than two a Scripting solution might be more convenient than the other methods, so in that case you could also ask over at

                  http://forums.adobe.com/community/photoshop/photoshop_scripting

                  • 6. Re: How do I view two layers alternately
                    c.pfaffenbichler Community Member

                    there's no shortage of shortcuts for other moves

                    That seems debatable.

                    As far as I can tell most default Keyboard Shortcuts trigger one operation that corresponds to one Menu or Panel item – whereas what you want is dependent on the way you structure your files and involves variables that the programmers of Photoshop can hardly be expected to predict.

                    The workaround possibilities seem reasonable to me and could (some at least) be assigned Keyboard Shortcuts of your liking if the task merits such for you.

                     

                    You could always post a Feature Request over at

                    http://feedback.photoshop.com/photoshop_family/

                    • 7. Re: How do I view two layers alternately
                      Grant H Community Member

                      a script may even be overkill and may require a number of clicks anyway...

                       

                      in the history panel flyout menu, click history options, check the "make layer visability changes undoable" box, and check the "allow non linear history box": click ok.... (now history will "record" layer visability changes and allow deleting of individual history states)

                       

                      from now on cmd : select the layers in question, r-click the eye, hide layer, then show one, hide it, show other ... or what ever workflow you prefer..

                       

                      then you can either opt-cmd-z (prev state) or shift-cmd-z (next state) to toggle, or you can (best way) "toggle" click on the relevent history states in the panel, and even delete the unwanted history state/s allowing for plain ol cmd-z...

                       

                       

                      G

                      • 8. Re: How do I view two layers alternately
                        c.pfaffenbichler Community Member

                        a script may even be overkill and may require a number of clicks anyway...

                        It may well be, but one can set it up to hide all but one of selected Layers (if more than one of them is visible) and on following iterations hide the one visible Layer and show the next one.

                        • 9. Re: How do I view two layers alternately
                          Mahombi Community Member

                          Thanks Grant. That pretty much does what I was looking for.

                          • 10. Re: How do I view two layers alternately
                            c.pfaffenbichler Community Member

                            If you want to give a Script a try, paste the following text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit CS4 or /Applications/Utilities/Adobe Utilities-CS5/ExtendScript Toolkit CS5) and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.

                            After restarting Photoshop the Script should be available under File > Scripts and can be assigned a Keyboard Shortcut directly, recorded into an Action, (in CS4 and CS5) be used in a Configurator-Panel or started from ExtendScript Toolkit directly.

                             

                            The Script hides all but one of the selected Layers (no Groups), if only one of the selected Layers is visible it hides this one and shows the next.

                             

                            // show one of the selected layers in turn;
                            // 2012, use at your own risk;
                            #target photoshop
                            if (app.documents.length > 0) {
                            var myDocument = app.activeDocument;
                            var theLayers = GetSelectedLayers();
                            //alert (theLayers.join("\n"));
                            var theVis = [];
                            // hide the layers;
                            for (var m = 0; m < theLayers.length; m++) {
                                      if (theLayers[m].visible == true) {theVis.push([theLayers[m].visible, m, theLayers[m]])};
                                      theLayers[m].visible = false
                                      };
                            // show one layer;
                            if (theVis.length == 1) {
                                      var theNumber = theVis[0][1];
                                      theVis[0][2].visible = false;
                                      if (theNumber == theLayers.length - 1) {var theNext = 0}
                                      else {theNext = theNumber + 1};
                                      theLayers[theNext].visible = true
                                      }
                            else {
                                      theLayers[0].visible = true
                                      };
                            };
                            ////////////////////////////////////
                            // function by paul mr;
                            function GetSelectedLayers() {
                            var A=[];
                                var desc11 = new ActionDescriptor();
                                    var ref9 = new ActionReference();
                                    ref9.putClass( stringIDToTypeID('layerSection') );
                                desc11.putReference( charIDToTypeID('null'), ref9 );
                                    var ref10 = new ActionReference();
                                    ref10.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
                                desc11.putReference( charIDToTypeID('From'), ref10 );
                                executeAction( charIDToTypeID('Mk  '), desc11, DialogModes.NO );
                            var gL = activeDocument.activeLayer.layers;
                            for(var i=0;i<gL.length;i++){ 
                            A.push(gL[i]); 
                            } 
                            executeAction( charIDToTypeID('undo'), undefined, DialogModes.NO );
                            return A;
                            };
                            
                            • 11. Re: How do I view two layers alternately

                              Hi

                               

                              Use ctrl and rectangular brackets []

                              to selecting alternate layers

                               

                              ------------------------------------------

                               

                              Message was edited by: Peter Spier

                              • 12. Re: How do I view two layers alternately
                                Mahombi Community Member

                                Hi maytaurus. Just tried what you recommended and nothing happened. Can you elaborate?

                                 

                                Mahombi

                                • 13. Re: How do I view two layers alternately
                                  Trevor.Dennis MVP

                                  maytaurus wrote:

                                   

                                  Hi

                                   

                                  Use ctrl and rectangular brackets []

                                  to selecting alternate layers

                                   

                                   

                                  Ctrl/Cmd [ or ] move layers up and down the stack.  There are other suggestion further up the thread that will help.