Measure pixel area

Photoshop CS6 script for measuring pixel area of a selection.

Tutorial site: Measure pixel area for pie charts
Script download: Zip Archive

Description:

This script makes the measurement of complex selections in Photoshop a lot easier. By giving a title or description to the measurement, you can save this measurement to a list. This list holds the given title, the area of the selection. The scale units (if previously set on the Photoshop CS6 Measurement settings), the count of separate areas of the measured selection and the Scale Factor.

By continuosly running the script and saving the measurements the script will automatically create logfiles in the active Photoshop document folder. As long as those files will not be deleted the measurements will be available in every session the Photoshop file is opened.

The last and most important feature of this script is exporting all the information in the measurement list to a *.csv file which can be open in Excel for further editing.

Requirements: Photoshop CS5, CS5.5 or CS6 Extended on Windows or MacOSX.

Author and copyright: Florian Frank

Installation:

  1. Download the zip archive from the link above.
  2. Copy the "measure_area_blickfeld7" folder from the zip archive to "Program Files/Adobe/Photoshop CS6/Presets/Scripts/" or on Mac to "/Applications/Adobe Photoshop CS6/Presets/Scripts". Take care not to copy just the content of the measure_area_blickfeld7 folder. In that case the Script will not work.
    Folder Screenshot
  3. (recommended) Create a Keyboard Shortcut by clicking the Menu on "Edit - Keyboard Shortcuts...", selecting "File - Scripts - Measure Area by bf7" and setting a shortcut combination for example "Ctrl + Shift + A" or "Shift + ⌘ + A" on a Mac.
    Create Shortcut

Instructions for use:

  1. Open an image file in Photoshop.
  2. Make a selection.
  3. Start the script either by the created keyboard shortcut or by clicking on "File - Scripts - Measure Area by bf7".
  4. The main window of the Script will open and look like this: Screenshot
  5. You can define a scale by typing into the "Set Scale" panel: name, a pixel length and the corresponding lenght in a preferred unit. By clicking on the floppy disc icon button the settings will be saved for this document and take effect for each measurement. The name is required in order to save the scale correctly.
    Tip: You can measure a known length in the image with the Ruler Tool (under the eyedropper list or by pressing "Shift + I" several times).
  6. In order to save a measurement. Type a title or description into the textfield on the upper left and click on "Add...". This will create a logfile on the Photoshop document folder and add a new entry to the measurement list on the window.
  7. After a measurement is registered in the list you can close the window and make another selection. Then run the script again. You can repeat steps 3. to 6. how often you need to.
  8. To export the given measurement list click on "Export..." next to the Close button. This will ask you first if you want to delete the logfiles. By deleting the logfiles the measurement history in this Photoshop script will be empty after the export. It is recommended to not delete the logfiles on export, you can do this manually, simply by deleting the "measurement_backup" folder in the corresponding Photoshop document folder.
  9. The exported *.csv file can be directly opened in Excel for further steps such as calculations and charts. The Excel file will have the same structure as the measurement history table in the Photoshop Script.

 

HOT TIP:

Working on different Photoshop files in a common folder can be useful with this script. All the Photoshop documents from the same folder will have one measurement history together and measurements from one document can be combined with another document. So at the end you can export a common measurement list for all of these files.

By copying the measurement_backup folder with the Photoshop files the measurement list can be used on different computers (with Photoshop CS6 Extended and this Script installed).

An error can occur when a Photoshop file is opended from a locked folder or a source to which you don't have write permissions. In this case the Script cannot save the measurement logfiles. Copy the Photoshop file (and if existing the measurement_backup folder) to a folder on your harddrive and try again.

 

BUG:

A common bug will occur if the logfiles from a Windows computer will be transferred to a Mac or the opposite. This will lead to strange results in the listing of the measurements. Currently there is no way to avoid this.