# Calculate specific areas size in image

I'd like to calculate what area size share do the brown spots take within the area marked with pink lines. See the image here:

In case you wonder what that is - it's an E.coli bacteria colony (don't worry, nothing dangerous) :)

Anyway, I'd like to measure the area that brown spots take, I guess Photoshop will do (not very experienced with it though).

My line of thinking for doing this is:

• Crop the image to areas that are outlined with pink color (would get two images in this case). This is fairly easy and I would know how to do it (selection + crop image to selection).
• Make the image black&white, so the background is white and the spots are black (it should be easier then to calculate the size of the spots).
• Calculate/measure the size of the black spots. If I get this number, I can easily divide it by the size of the image and get the percentage of the area that these spots cover :)

What would be the steps to do that in Photoshop (if it's possible at all)? Or would you recommend some other program?

• I do would not consider this a design question. If the task you are performing is a common one in a biology, I would expect that programs for this purpose exist and that you get much better answers on Biology SE. In the unlikely case that it isn’t, this sounds like something for Software Recommendations SE. Commented May 9, 2015 at 21:19
• I'm voting to close this question as off-topic because it is not a design question although common design tools may be in use. Commented May 9, 2015 at 21:32
• @Wrzlprmft they use Photoshop quite much, yes that's why the measure thing was added to extended Commented May 9, 2015 at 21:49
• Yes things like the measurement features were beefed up in Photoshop extended for use in things like scientific research, not design. While this may be a valid "Photoshop" question, I see it as not a valid "design" question. And this is not an application support stack. This would be better answered at SuperUser.com Commented May 9, 2015 at 22:05
• @Scott i didn't say that Photoshop use is graphic design. i said Photoshop is used. Anyway the thing about how camera works is for interest to graohics designers. Commented May 9, 2015 at 22:10

A camera produces a image that loses any scale information. That is because the projection is flat. Objects at different distances appear sized differently. Likewise certain objects can appear the same.

Image 1: The projection loses sense of scale

This said its possible to know the size, if you have a pair of images (and multiple points in different depths to measure) and a reference measurement in the image.

It is also possible that you just want to compare sizes. In this case the petri dish size is known. Then it can be done if the camera is perpendicular to sample, or sample is perspective corrected right (but this incurs a hard to estimate error).

Image 2: Head on view of a petri dish, image source.

## Computing area by relation on perpendicular surface.

If you can photograph like head on like image 2. Then you can just measure the pixel area of the entire circle, and compare that to your marked area. Since the dimensions of the petri dish are known you get a simple relation.

Arp * (Apm /App ) = Arm

Where Arp is the real area of the petri dish (πr 2) in whatever units you want,
Apm is the pixel area of your region in pixels (pm = pixel measurement),
App is the pixel area of your petri dish floor (pm = pixel petri dish) and finally Am the are you wanted to measure.

You can get Photoshop to report number of selected pixels in the extended version of histogram view. This is the area of the selection in pixels.

Image 3: Dummy measurement, gets me an area of ~ 0.15*2800 = 420 mm2 for a petri dish with 60 mm diameter . No measurement confidence calculation done.

Please note due to scale loss effect above you can not use image are for measurement as the distance to target and size/off axis alignment of image is unknown. Measuring both areas ensures a measurement error that is better behaved even if the camera is slightly of axis for said sample.

## For fun

For a fun deepening understanding in aultomatic 3D correction see The Fundamental Matrix Song

PS: Not entirely Graphics design. After edit definitely no longer Graphics design.

• PS:; Not even remotely graphic design :) Commented May 9, 2015 at 21:53
• @Scott i dont know, you might need this if you need to estimate how something looks wrapped on a car body for example. Commented May 9, 2015 at 21:55
• Just my opinion, but I can't envision any design scenario where you'd need to calculate the area of a pixel. In printing, there are things like ink limits, but that deals with % of coverage in a different manner. While your answer is a good one. Unfortunately I think the entire question is nowhere near a "design" question. Commented May 9, 2015 at 21:59
• @scott Now it Definitively no longer a GD question :P Commented May 10, 2015 at 10:16

We can ask this question to be a related Graphic design issue by re-formulate the question "how can I draw any drawings with scale 1:1 based on a photograph?".

Of course if you know exactly how the photograph represent the real dimension so it will be easier to know some more geometric information like length volumes and areas from a photograph. that's what we called proportions .. if you know any dimension in the photo you can concludes and predict the other dimensions. so proportions is a comparative relations between two geometric shapes.

let's say you have an image like the one below.

Definitely the cube is very huge comparing to the man that approximately we already know how tall he is. the cube is almost 2 times taller and 1.5 times wider and 1 time deeper. so if that man is 1.7m taller (relative to his head) so we can predict the width, height and depth of that cube.

what I need to tell you is you have to re-photograph your subject and add somthing you can predict its dimensions. like a penny or a small scale.

That's exactly what archaeologist scientist do when they excavate something in field. In the image below there is a scale in the floor represent exact dimension between hols and you can predict the diameter of each hole from that image.

in the next example you can see the egg of a "Violet-green Swallow" you can now figure out how small it is when it is compared to a penny.

The question is ... how to know the exact dimension from an image like the the two above? the answer in a small graphic design proceed (trace and scale and measure the area)

Simply we will trace your pink lines (object A) and something we can measure (Object B) (let's say a small scale or a penny) and scale both traced lines based on object (B) and then we can know the exact area of object (A).

here you are some tips when you gonna shoot your subject to get areas from:

1. make sure to not shoot your subject in a perspective projection, as much as you can take your shoot perpendicular to the subject.
2. take the shoot with a lens that have long focal lens and zoom to your object to decrease the "Fish-eye" distortion effect occurred in low focal length lenses.
3. put a ruler scale or penny or anything you can measure beside you object.
4. put a grid background underneath your subject to correct the lens distortion in Adobe Photoshop.
5. take three or four shoots to take the average area for more accuracy.
6. Trace the result photographs in any vector based software like Adobe Illustrator or Inkscape. trace both the object that have unknown dimensions and the know one.
7. Scale your traced objects based on the known object.
8. from the info panel you can know your unknown object dimensions.
• The petri dish most likely has a standard size if the picture shows entire dish than it should be possible to tell the size. went ahead and added that to my answer, can you or @Scott suggest another stackexhange site for this question. Photography? Commented May 10, 2015 at 10:23
• not really all petri are the same, anyway thank you @joojaa -- that kind of question is most common between photography and graphic designing even it is common in CAD and 3D camera match. I don't see any objections to suggest it to the photography questions. but guys over there are really taking it so seriously ;) they will return it here again. Commented May 10, 2015 at 10:51
• Sure tricky stuff i posted a question on bilogy.se chat but they are not so active. Physics ruled this out. Commented May 10, 2015 at 10:56

Print out the object(s) onto paper, then cut out your area of interest weigh them (needs a scientific balance - electronic). Also if not sensitive enough enlarge and reprint. Worth a try. Retired Clinical Biochemist P.S. I used this when I was trying to estimate bands on gel electrophoresis many many years ago pre-digital.