6 Replies Latest reply on Nov 30, 2017 8:39 PM by JJMack

    Scripting Lens Correction to process millions of photos

    LeeVDuhl

      We have several million "Fish-Eye" images that we need to flatten out and the new "Lens Correction" feature of Photoshop CS5 appears to work pretty well.  I was able to use the predefined File -> Automate -> Lens Correction function to process a hanfull of images and it worked fine for a small batch.

       

      I would like to know if there is a way with Photoshop CS5 to script/batch out a process so that I can use it to process the millions of individual files we need to have processed.

       

      Also, I am not familiar with the Photoshop "Batch" or "Scripting" process, so assuming the above request is possible, some direction on how to proceed would be greatly appreciated.

       

      Thank You.
      Lee

        • 1. Re: Scripting Lens Correction to process millions of photos
          JJMack Most Valuable Participant

          "Millions of individual fisheye files" I find that hard to beleive think your full of it your not "Starkiss" quality Charley. For fewer then millions you might try creating an action to applies the lens correction filter and use it with the Image Processor Script that ships with Photoshop. Fear that if indeed you do have several millions of fisheye files that you would run out of disk space for the Image processor creates new files and leaves your fisheye files on disk. Several Millions of mega bytes files start to add up to real space. You'll need a big stripped raid setup use TERROR Byte drives and expect it to take a terrifyingly long time.

           

          Several,000,000 times Several,000,000 = Several Squared,000,000,000,000 Bytes.

          • 2. Re: Scripting Lens Correction to process millions of photos
            LeeVDuhl Level 1

            Unfortunatly I'm talking millions of images.  Anwhere from 3 to 20 millon. Space is not an issue but time may be but that will all be evaluated during this process.

             

            From what I've figured out so far, handling this via a script would probalby be the best way to handle it as I may have to do some other integration in order to retrieve my lists of files to process, handle errors and dynamically name the saved images.  I also believe scripting will allow me to run the process from outside of Photoshop.

             

            For now, however, I'm trying the simpler approach mentioned above.  So how would I go about creating an action to applie lens correction?

             

            Thanks

            Lee

            • 3. Re: Scripting Lens Correction to process millions of photos
              JJMack Most Valuable Participant

              Open a fisheye lens image in Photoshop

              Open the Actions Palette click on add new Action Set Icon in the botton of the Actions Palette looks like a folder name it ImageProcessor Actions

              Click on add New Action Icon in bottom of the Actions Palette name it lens correction click record.

              Use Photoshop menu Filter>Lens Correction... In the Lens Correction dialog make all the setting required for your Fisheye lens and click OK

              Click on the Stop recording button in the Actions Palette

              Hightlight the Action set you just recorded the action into in the Actions Palette

              Use the Actions Palette fly-out menu in the upper right corner of the Actions Palette item Save Actions and save your action.

               

              Scripts and actions run inside Photoshop not outside.... Also Lens Correction in Photoshop is done by a Photoshop Filter Plug-in that runs from within Photoshop. I quite sure you used this indirectly when you used menu File>Automate>Lens Correction... which runs a an Automate script "Lens Correct.jsx" the lens correction plug-in is also used indirectly within a PhotoMerge stack from the stack script "LensCorrect.exv".

               

              If your images are within a single file system tree you can point the Image Processor script at the root and check include all subfolders also point the Image Processor at your action and where you want the new files saved then click Run. Then go on vacation perhaps when you return from vacation all the images files will have been processed. Using Links within the file system tree you may even be able to process more then a single tree. If your images are from more then one Fisheye lens types and focal length.  You may have to script the Lens Correction Plugin like done in the Automate Lens Correction script. "Lens Correct.jsx" there is a large comment in it that may help you understand how to do that.

              2 people found this helpful
              • 4. Re: Scripting Lens Correction to process millions of photos
                LeeVDuhl Level 1

                Thanks for the info.  This did it thanks.  Now on to a basic script which I will make another forum post for.

                 

                Thanks.

                • 5. Re: Scripting Lens Correction to process millions of photos
                  flick h

                  So it's much later now but I still have this question - I did all the steps you mentioned but you say "you can point the Image Processor script at the root and check include all subfolders also point the Image Processor at your action and where you want the new files saved then click Run."

                   

                  I don't get where this happens - point it how?  I'm now on Photoshop CS6