3 Replies Latest reply on Sep 15, 2016 10:18 AM by JJMack

    select focus parts

    Level 1

      I turned on many sites and read a lot but could not find anything about it

      is there a way to select only the parts of the photo Fire

       

      I ask this because 'I have lots of pictures and I have to apply changes only on part of the image in focus.

       

      there is a script or an algorithm that allows you to do this?

        • 1. Re: select focus parts
          JJMack Most Valuable Participant

          The newer version of Photoshop have a feature menu Select>Focus Area. That open a Dialog the you can adjust setting in. And when done have it make a selection.  The Scriptlistener Plug-in record this operation so it should be able to be scripted. However I have never tried to. You should try to script selecting the in focus area.  The dialog has some Auto Settings I would try recording these on Script listener.  Should look something like this:

           

          // =======================================================

          var idfocusMask = stringIDToTypeID( "focusMask" );

              var desc8 = new ActionDescriptor();

              var idfocusMaskUseAutoInFocusRadius = stringIDToTypeID( "focusMaskUseAutoInFocusRadius" );

              desc8.putBoolean( idfocusMaskUseAutoInFocusRadius, true );

              var idfocusMaskUseAutoImageNoiseLevel = stringIDToTypeID( "focusMaskUseAutoImageNoiseLevel" );

              desc8.putBoolean( idfocusMaskUseAutoImageNoiseLevel, true );

              var idfocusMaskBinarySegLambda = stringIDToTypeID( "focusMaskBinarySegLambda" );

              desc8.putDouble( idfocusMaskBinarySegLambda, 500.000000 );

              var idfocusMaskUseSoftMask = stringIDToTypeID( "focusMaskUseSoftMask" );

              desc8.putBoolean( idfocusMaskUseSoftMask, false );

              var idfocusMaskUseAutoBinarySegSigma = stringIDToTypeID( "focusMaskUseAutoBinarySegSigma" );

              desc8.putBoolean( idfocusMaskUseAutoBinarySegSigma, true );

              var idfocusMaskPowerLaw = stringIDToTypeID( "focusMaskPowerLaw" );

              desc8.putDouble( idfocusMaskPowerLaw, 1.000000 );

              var idfocusMaskOutput = stringIDToTypeID( "focusMaskOutput" );

              var idfocusMaskOutput = stringIDToTypeID( "focusMaskOutput" );

              var idselectionOutputToSelection = stringIDToTypeID( "selectionOutputToSelection" );

              desc8.putEnumerated( idfocusMaskOutput, idfocusMaskOutput, idselectionOutputToSelection );

          executeAction( idfocusMask, desc8, DialogModes.NO );

          2 people found this helpful
          • 2. Re: select focus parts
            Level 1

            Thanks JJMack

            It seems fine although not 'very precise.

            • 3. Re: select focus parts
              JJMack Most Valuable Participant

              If Adobe Auto adjustment is not to your liking. You can turn on the dialog and make it a user interactive adjustment.   Or you could get Adobe SDK and write  a plug-in that would do it precisely the way you code it.

              2 people found this helpful