Digital Pinhole Camera

Having seen an article on pinhole cameras I decided to make a pinhole “lens” for my digital camera. There are numerous articles on the internet about how to do this and pinhole photography in general. The advantage of digital pinhole photography over the traditional method is the ease of use in terms of not having to deal with light sensitive paper or film and the instant feedback and ability to adjust exposure immediately without having to wait to develop prints.

I used this article as a base : to make a pinhole camera. Basically by using a spare plastic body cap (available cheaply on ebay) and using it as pinhole “lens” i.e. a 1/4 inch hole is drilled in the centre of the cap and then a thin membrane containing the pinhole is taped to the cap which can now be attached to the camera.

Drilling the larger hole in the body cap is straight forward, making the pin hole less so but not insoluble.

Making the Pinhole.

Commercial Pinholes Lenses are available but part of the goal was to try and make it as much as possible a DIY project.

Researching the topic further there are a number of key factors that will affect the quality of image. The pinhole membrane should be as thin as possible and the  size and roundness of hole are also critical factors. The first thing to determine is the size of hole required. This is determined by the distance between the pinhole and the focal plane of your camera, this information is generally available in your camera manual. Alternately the focal plane is normally marked on the camera body and with the lens removed and a straight edge across the front mounting surface of the camera a reasonably accurate measurement can be made.

Obtaining a thin membrane is very straightforward as any used aluminium drinks can will suffice, the walls being extremely thin.

Strip cut from can

Strip cut from can

Most probably, the first person to try to find a formula for calculating the optimum hole diameter was Josef Petzval (January 6, 1807 – September 19, 1891) a mathematician, inventor, and physicist best known for his work in optics.Petzval studied and later lectured at the Institutum Geometricum (currently Budapest University of Technology and Economics) in Buda (today part of Budapest).  Petzval is considered to be one of the main founders of geometrical optics, modern photography and cinematography. His formula was later improved by the British Nobel Prize-Winner Lord Rayleigh. The equation, on which he worked for ten years and which is valid to this day, was published in his book Nature in 1891. Several more formulas have appeared since that time, often derived from the same base. (

Also available from the same site is a very useful free program “Pinhole Designer”   available from which uses the Petzval / Rayleigh formula for calculating the size of hole required. It will also provide additional technical information such as angle of view, magnification all of which will help design an optimal pinhole camera.

For my particular camera and body cap with a distance between the focal plane and body cap of 48mm this gives a result of a 0.3 mm pinhole required. The distance of the focal plane also affects the effective focal length of the lens, the closer the focal plane is to the pinhole the more “wide angle” the result. To obtain a more telephoto effect it is necessary to extend the distance between the pin hole and the focal plane, this would be possible by using extension tubes, very cheaply available when no electrical contacts are required. However this will also affect the pinhole size required. Also the use of extension tubes may help improve the focus of the pinhole, this wasn’t tried for the current project due to time constraints in obtaining suitable extension tubes  but maybe investigated in the future.

The technique described in the original article for making a pin hole was to make a dimple in the can material with a sharp needle and hammer and then rub it down using an abrasive on the other side to make a hole. I found this method difficult to accurately size the shape and diameter of the resulting hole.  So to make the pinholes I purchased 0.3 mm drills however these are impossibly small to hold and require precision drill press to utilise, fortunately a friend of a friend had the necessary high speed drill (10,000 RPM) and a drill press to able to drill the holes.

Drills and finished Pinhole

Drills and finished Pinhole

Caps with pinholes taped in place.

Caps with pinholes taped in place.










Once suitable holes were drilled in an aluminium strip cut from the can it was a simple matter to gaffer tape this into the body cap. The friend also had 0,5 mm drills and so I made a second body cap using this size to use as a comparison later. So the total cost of the pinhole camera project was £1.50 for the body caps and £1.70 for the drills, a couple of hours time and some fuel along with the good will of friends.

In use.

The pinhole designer program will also work out the theoretical f-stop / depth of field for your pinhole which in my case was F160, such extremely small apertures obviously require fairly lengthy exposures and the exposure factor from the program indicated a factor of 52.9 e.g. a 1 second exposure at f.22 would require 53 seconds at F160.

To help this I made a table (based on the pinhole designer program) and then mapped it to the actual shutter speed settings available on my camera. To take a shot I used an 50mm standard lenses set at F22 to meter the scene and then used the table below to calculate the speed for the pinhole.

Metered Speed at F22 F Stop Conversion Factor Nearest 5D Camera
Fraction Decimal 52.9  Speed Available
1/1000 0.0010 0.0529 1/20 (0.0500)
1/500 0.0020 0.1058 1/10 (0.100)
1/250 0.0040 0.2116 1/5 (0.200)
1/125 0.0080 0.4232 1/2 (0.500)
1/60 0.0167 0.8817 0.8 (0.800)
1/30 0.0333 1.7633 1.6 (1.600)
1/15 0.0667 3.5267 3.2 (3.200)
1/8 0.1250 6.6125 6 (6.000)
1/4 0.2500 13.2250 13 (13.000)
1/2 0.5000 26.4500 25 (25.000)
1 s 1.0000 52.9000 Bulb
2 s 2.0000 105.8000 Bulb
4 s 4.0000 211.6000 Bulb
8 s 8.0000 423.2000 Bulb


In practice this gave a good starting point and then using the digital display as a guide the exposure was adjusted to obtain a pleasing result. On a digital camera, with no f-stop adjustment available then, there remain two ways to adjust exposure, shutter speed and ISO setting. I used a combination of these settings to vary the exposure. Although using a tripod, I tried to keep exposures in the 1-2 seconds bracket for speed of image taking.

The only other issue is that due to the small aperture the viewfinder and / or live view are virtually useless for composing the image, accordingly its a question of trial and error to obtain a good composition. This is of course very rapid with a digital set up and increases the success rate compared to traditional methods where there is no immediate view of the resulting image until processing is complete.


The images were taken in my local town, Cricklade on Saturday 26th April 2014.

Image with 0.5 mm Pinhole. (click on images to enlarge, back button to return).








Image with 0.3 mm Pinhole








The results of the 0.3 mm pinhole are so much obviously sharper than the o.5 mm version that use of the 0.5 mm pinhole was discontinued.

The images below were processed in Photoshop, adjusting levels, contrast and adding some sharpening. Although the images are so soft the effect of sharpening was minimal, I also tried a Photoshop plug-in called Focus Magic which gave a distinct improvement. When time permits I intend to investigate the use of macro tubes to improve the focus out of camera and also with an Infra Red camera to see any difference in focus due to difference in light wavelength and the effect of a cropped sensor.

St Mary’s, Cricklade 0.3mm sharpened with smart sharpen








St Mary’s, Cricklade 0.3mm, Sharpened with Focus Magic








Red Lion, Hanging Baskets











St Sampson’s, Cricklade











Click here to return to Technique Journal Index.

Update 5th May 2014.

Obtained some cheap macro extension tubes and made some sample images to compare results.

50 Mm Standard Lens at f22 to provide sharpness comparison and meter exposure 1/60 for this lens, applying conversion factor from table above 0.8 seconds for the pinhole lens.








Pinhole, with body cap direct into camera body focal length is almost exactly 50 mm, pinhole image is much, much softer than glass lens version.








Same scene with 9mm macro extension, no discernible change in sharpness but telephoto effect of increasing focal length, I had expected some change in sharpness either an improvement if the pinhole is actually oversized compared to the calculated size or worsening if the focal length is now no longer optimal for the pinhole size.








16mm Extension Tube, again no apparent change in sharpness but increased telephoto effect.


This entry was posted in Technique Journal.

Post a Comment

Your email is never published nor shared. Required fields are marked *