# How to calculate the optimal pinhole size?

As far as I've understood, optimal diameter for pinhole size is calculated by formula where

d - the optimal diameter for pinhole
c - constant
f - focal length (distance between pinhole and film/sensor)
λ - wavelength of light the pinhole should be optimized for

f and λ should be in same units as desired for d

Different sources seem to agree that about 550nm (green-yellow) is a good value for λ, and the focal length part is also quite clear.

However, each source seems to provide different value for the magic constant c

The difference of 34% between smallest and largest suggested value seems quite significant.

Why are there so many different values for the constant? Are different constant values optimizing different properties of resulting image? Or perhaps different constants apply to different pinhole material thicknesses (if that's the case, do bigger constants go for thicker materials)?

• I'm struggling to figure out how the value of d relates to the pinhole size. I had an answer (based on c=1.414, f=50mm) of 234? if this is mm thats a bit big! if thats nm thats far too small... Should all figures be in nm, mm, etc?? – Digital Lightcraft Jan 3 '14 at 9:50
• All figures should be in same units as you want the result in (mm seems to be most common; 550 nm = 0.00055 mm) – Imre Jan 3 '14 at 10:46
• As far as I'm aware - differences between these will be rather insignificant in exposure (you'll learn them after few exposures and than just apply your own exposure compensation to balance out exposure exactly as you like it) - it's much more important to get a perfectly round pinhole, than whatever it's 34% bigger or smaller. – MarcinWolny Jan 3 '14 at 10:48
• There is no optimum value for the size of the pinhole as it depends on the relevant importance to you of: peak sharpness, average sharpness, light sensitivity, as well as the type of scene you are photographing. – Matt Grum Jan 3 '14 at 11:33
• @MattGrum if you could describe how increasing/decreasing hole size affects those properties, that'd be awesome (and also an answer to what I'm asking here) – Imre Jan 3 '14 at 11:47

I can't summarize the whole optical physics theory behind pinhole (mostly because I don't have the proper knowledge!), but I try to explain why there are different values for constant `C`. One reason that there are different values for `C` is the fact that one parameter in the calculation of optimum diameter of hole is missing! Let us refer to the wikipedia article that you mentioned:

Within limits, a smaller pinhole (with a thinner surface that the hole goes through) will result in sharper image resolution because the projected circle of confusion at the image plane is practically the same size as the pinhole. An extremely small hole, however, can produce significant diffraction effects and a less clear image due to the wave properties of light.

This means `the purpose of C is to find a value that results in good trade off between sharpness and diffraction`. Determining this value, however, is dependant on another factor and that is the distance of the subject to the camera. Circles on the bottom shows the effect of pinhole size on the resulting image. In the second figure dashed line (geometric limit) is the resolution and solid line is the diffraction. As you can see the diffraction is affected by `θ` which is a function of distance to the pinhole.

With all being said, IMHO, the whole reason behind different values for `C` is the fact that it is obtained empirically and each of them had a different value for `p` (with reference to the first figure).

P.S. I had a look at the source of the `mrpinhole.com` page and it seems they are using `C=1.92`.
P.P.S. Having a look at those websites, it seems each of them have a different value for `λ` and this could lead to different value for `C`.