
Pinhole optimization
The size of a pinhole in a simple camera is not critical so long as it is small enough to resolve reasonably well. However, it is possible to optimize a pinhole for a particular camera, resulting in sharper images.
When a pinhole casts an image, each subject point is represented by a corresponding image point at the film plane. The smaller this image point, the more resolved the image. The smaller the pinhole, the smaller the image point. The catch is that there is a limit to how small. If light simply traveled in straight lines, then the perfect pinhole would be only large enough to pass one ray of light per subject and image point. But light actually travels in waves, so diffraction becomes a factor. Light waves raking across the edge of the pinhole spread away from the image point and the quality of the image falls off sharply. Also, a tiny pinhole produces an image too faint to work with practically.

The back flap of this camera's front box is channeled to hold one sheet of film. It swings up to hold the film in place and, once the back box is slid into place, helps to form a light baffle. 

Since a pinhole is much larger than one ray of light, the light passing from one point on a subject to a corresponding point on the film plane is actually a bundle of rays. Since it is the nature of light to spread after it is reflected, this bundle of rays takes on the shape of a cone. The base of this cone as it strikes the film plane is the image disc. Note that the farther the subject from the film plane (using the same length camera) the larger the image disc.
The image discs are surrounded by a series of rings. The rings are a result of diffraction of the rays of light which scrape across the edges of the pinhole. The light in these discs is extraneous as far as the image is concerned, reducing resolution and blurring the image. As a pinhole approaches smaller diameters, these diffraction rings become more prominent. The resolution of an image is based on a) the size of the image discs; b) the amount these discs overlap one another; and c) how prominent the disc itself is compared to its rings (fainter, tighter rings are better). The basic rule of thumb was originally the larger the pinhole, the farther it needed to be from the film plane (to a point).
Lord Rayleigh (1842  1919), a physicist known for many discoveries including the codiscovery of argon, worked extensively in optics, and studied seriously pinholes. He determined that a pinhole performs best at its own focal length, and that the square of the optimum pinhole, d^{2}, is equal to the product of a constant, K; the pinhole to image distance, b; and the wavelength of the light being considered, ; giving the equation:
d^{2}=Kb
For object distances less than 10 or so camera lengths (infinity), the variable a, representing pinhole to subject distance, is introduced, giving:
1 1 K Kab
a + b = d^{2} or d^{2} = a+b
K is a constant for regulating the amount of overlap between two adjacent discs (and, in turn, also affects disc size and the diffraction rings). The value K=1 is ideal, giving the natural focal length of the pinhole, and a 50% overlap of the radii, thus theoretically giving the highest attainable resolution. However, this requires an extreme camera (b) length, and a very high aperture to camera length ratio, or f/stop. This results in an unwieldy camera and a dim image. So a compromise must be met between enormous camera length and detectable loss of sharpness.
The value of K is still debated among those who work with optical systems. Rayleigh himself suggested K=3.24, which would give, in his opinion, the maximum acceptable overlap of approximately 90%. Other physicists have suggested values of 1, 2, 2.56, 3.6, and 3.8. When designing your own camera, pick whichever value is most practical between 2 and Rayleigh's of 3.24. If you are designing a system for close, detailed work, it is best to use as low of a K value as practically possible.
The value for is the wavelength of light being considered. Average peak sunlight is around 5500 angstroms (Å). To plug this into the formulae, you will need to convert it to whatever base unit you are calculating with. 1 Å = .1 nm or 0.0000001 mm (1e07 mm); so 5500 Å = .00055 mm.
Values for any of the variables can be found by rewriting the formulae. Remember:
 a = subject to pinhole distance
 b = pinhole to image distance
 D = diameter of pinhole
 = wavelength of light
 K = the constant
If the subject distance (a) is greater than 10b, or ten camera lengths, then the camera can be considered focused at infinity, and a does not need to be included in the equation:
D^{2}=Kb b = D^{2}/K
For subject distances closer than 10b, and for critical work:
D^{2} = (Kab)/(a+b) b = 1/((K/D^{2})(1/a))
It is also possible to calculate the size of the diffraction discs, if you are so inclined; b/d gives the fnumber, or N. The symbol represents the diameter of the diffraction disc (the outermost diffraction ring, not the central image disc itself).
=2.44(N)
The percentage that the discs overlap one another can be calculated as 50 times the square root of K. The resulting number indicates how much a disc overlaps its neighbor's radius. If K=1, there is a 50% overlap of radii; if K=4 there is a 100% overlap, and the discs are edge to center.
Sewing needles are standard sizes, as follows:
needle mm in.
7 .66 .026
8 .58 .023
9 .51 .020
10 .46 .018
11 .40 .015
12 .35 .014
14 .30 .012
16 .25 .010
Remember that even though the size of the pinhole is not critical, optimization can make a significant difference in sharpness.
PINHOLE p. 1
PINHOLE p. 2
PERSISTENCE OF VISION

