13 Replies Latest reply: May 18, 2014 1:37 PM by debenllc RSS

    Script:  Trim the canvas to remove unused areas from the sides

    photodrawken Community Member

      If you're working on an image and wind up with a canvas that's larger than the image pixels, here's a simple little script that will trim away the unused areas.  It'll reduce the canvas to the smallest size that contains all the pixels of the actual images.  In other words, it takes the value of the top left pixel of the canvas and uses that info to trim away pixels, so this script will work on a canvas having transparent pixels as well as coloured pixels.

       

      Here are the steps to install the script:

       

      1. Open Notepad. 
      2. Copy this text and paste it into Notepad:


      /*

      <javascriptresource>
      <name>Trim</name>
      <menu>automate</menu>
      <about>Trim the canvas.</about>
      <category>Image</category>
      </javascriptresource>
      */

      app.activeDocument.trim()

       

       

      1. Use "Save As" with the File Type of "All Files" to save it as
        Trim.jsx
        in the
        C:\Program Files (x86)\Adobe\Photoshop Elements 10\Presets\Scripts
        directory.
      2. Start PSE.  You'll have a new menu item:  File...Automation Tools...Trim.

       

      Enjoy!

       

      Ken

       

      Message was edited by: photodrawken to correct explanation.