Pinhole Camera Simulator for Solargraphy
Author: Enzo De Bernardini Versión en españolSimulation of a pinhole camera made from a can, like the ones used to record the path of the Sun over several months. Adjust the size of the can and the diameter of the pinhole to get the size of the photographic paper, the optimal pinhole, the f-number and the field of view, and see how the sky is projected onto the curved paper. Step-by-step construction is covered in the solargraphy tutorial (in Spanish).
Can
Pinhole and paper
3D view
Image on the paper
The unrolled paper, with the sky projected by the pinhole. Without a photo, a grid of altitude and azimuth relative to the camera axis is shown, revealing the distortion of the curved paper. You can also load your own photo to see how the landscape would look.
Landscape photo
Display
Geometry of the can
The pinhole lies on the same circle as the paper. By the inscribed angle theorem, a ray entering at an angle α to the axis reaches the paper at a distance s = D · α from the center, measured along the curve. That is why the horizontal field is simply the width of the paper divided by the diameter (in radians), much larger than that of a flat paper of the same width, and lines of equal azimuth remain straight and evenly spaced.
The distance from the pinhole to the paper, however, shortens toward the edges (D · cos α): the same paper height covers more sky, and lines of equal altitude bend toward the horizon. Hence the characteristic arcs of solargraphs. Only the horizon, at the height of the pinhole, stays straight.
Optimal pinhole
A large hole gives a geometrically blurred image: the blur spot is at least as large as the hole. One that is too small blurs the image by diffraction, with a spot of 2.44 · λ · N. The balance is reached at d = c · √(f · λ). Rayleigh's constant is used here, c = 1.9, with λ = 550 nm (green light); other authors use values down to 1.56, and the difference is small.
Since the focal length shortens toward the edges of the paper, the optimum is exact only at the center. Toward the ends the hole is somewhat large for that distance, but diffraction also decreases.
Paper illumination
Horizontally, the curved paper receives uniform illumination. Seen at an angle, the hole appears smaller (cos α) and the light strikes the paper obliquely (cos α), but the distance shortens to D · cos α and the inverse square law exactly offsets both factors: cos α · cos α / cos² α = 1. A flat paper, by contrast, loses light toward the edges as cos⁴ α.
Image orientation
The emulsion of the paper faces the pinhole. Seen from that side, the image is upside down but not reversed left to right: it is a vertical mirror image, not a 180° rotation. A scanner, with the paper face down, gives exactly that view, and flipping it vertically is enough to straighten it. The “As on the paper” option shows it that way; the 3D view always shows it as it forms inside the can.
Your own photos
A regular photo, with a field of about 70°, covers less than half the field of a can; a 180° panorama or a 360° equirectangular image uses all of it. The photo is assumed to have been taken level: adjust the horizon height and the axis direction to match the scene you want to simulate. The part of the paper not covered by the photo is shown in gray.
If the photo keeps its EXIF data, the field is calculated automatically from the 35 mm equivalent focal length. For panoramas with GPano data, such as those from many Android apps and photo spheres, the projection and the horizon height are also read. Cropped photos, screenshots and photos that went through social networks or messaging apps usually lose that data or leave it invalid: in that case, set the field by hand.