spacer

Finding The Area Of An Object Using Photoshop

This is a way to estimate the area of any shape in Photoshop. I developed this technique because I didn’t have a better app or program to find the relative size of the sun (indicating its brightness) as it went through the solar eclipse in August 2017. I did this by filling the sun with little dots and then counting those dots and comparing the numbers for the sun at various stages of eclipse. In other uses, you would need to divide the number of dots in your shape of interest with the number of dots in a unit square (for example a square that was one inch on each side) to find the number of those units (square inches) that were in your shape. This technique will not give an answer with eight significant decimal places, but is good for quickly finding the area of complicated shapes. When I developed this technique, I had never used the pattern fill or count functions before.

Since I've surrendered to the 'cloud', I have trouble keeping track of which version of Photoshop I'm using, or for which versions this technique will work. Use at your own risk.

The Technique

  1. If you haven’t already done this, make a small pattern. For simplicity, I chose a small black dot, but if you really want to use the available small hollow red heart, that will work too.
    1. Select Custom Shape Tool (under the Rectangle Tool (shortcut U)).
    2. Select a shape. For the largest selection of shapes, you may have to click on the little gear in the upper right corner of the window and select "All".
    3. Make sure Pixels or Shape are selected instead of Path.
    4. Pick a color with some contrast to the background.
    5. Draw that shape on a blank layer.
    6. Use the Rectangular Marquee Tool to draw a rectangle closely around your shape.
    7. Click Edit ⇒ Define Pattern... Name your pattern and click "OK".
    8. Delete or erase your shape, layer, and selection rectangle.
  2. Select area to be measured.
  3. Fill the selected area with your pattern (you may want to do this on a blank layer above the desired shape in your photograph). Click Edit ⇒ Fill...
    1. Contents: Pattern
    2. Custom Pattern: select your simple pattern.
    3. Put a check in the Script: box
    4. Select Brick Fill
    5. Mode: Normal
    6. Opacity: 100%
    7. Click "OK".
    8. Pattern Scale: You may have to play with this. The smaller your pattern, the higher the count and the more precise your answer will be, but the Count Tool can only count to 4,094. Start around 0.5 for pattern scale. If this causes the Count Tool to max out in the next step, you can either increase the pattern scale, or divide your shape into segments.
    9. Offset between rows: I like 50%, but it doesn’t really matter.
    10. Leave all other settings at 0. Click "OK".
  4. Count objects.
    1. With the Magic Wand Tool, select your new fill objects to count (uncheck Anti-alias and Contiguous)
    2. Click Image ⇒ Analysis ⇒ Select Data Points ⇒ Custom
    3. In the Data Points area, under Selections, check "Count".
    4. Click "OK".
    5. Click Window ⇒ Measurement Log.
    6. In the Measurement Log window, click Record Measurements. Your answer will be in the new last line of the Measurement Log.
  5. Repeat Steps 2 through 4 to count fill objects of a reference area. This can be either a unit square or whatever else you want to compare your area to.
  6. Clean up your mess. Delete your dots and/or their layer, etc.

Well, that’s all there is to it. Congratulations.



You can contact us if you have any questions, or hit the Comment Button below if you have any suggestions for improvement.


Comments: none