Camera Lucida on Linux

So the story goes ...
4 min readAug 22, 2021

Both David Hockney, the English painter, and photographer, along with physicist Charles Falco, claimed that many advances in artistic realism since the Renaissance resulted from the use of clever optical instruments, including the camera lucida. This device superimposes a viewed subject onto a surface to aid drawing. Hockney explains that not only is there strong evidence that these tools were used, but also that there is no shame in using whatever tools help create your art.

The Stigma

For many artists and would-be artists, such drawing aids are avoided for fear of being characterized as cheaters. The truth is most artists, including the old masters, used whatever tools were available to them. Tracing and gridding are long-accepted tools for transferring or scaling drafts to canvases. Sculptors use calipers and pointing machines to maintain accuracy and proportion. It's just a tool.

Illustration from the Scientific American Supplement, January 11, 1879

So, now that I have convinced you that using drawing aids is just fine, and almost believe it myself, let’s talk about how computers are facilitating the “renaissance” of the camera lucida. The original camera lucida contained a prism that allowed a combined view of a subject and a drawing surface. Modern versions of this prism mechanism exist but require clumsy positioning of the head, hands, and drawing surface. Fortunately, smartphone and tablet apps are now available providing a digital alternative to the prism.

I have tried several of these apps, on my phone and on my tablet. I have to say, some have done a remarkably good job of recreating the awkward neck and eye-straining, formerly the province of the prism gadget. One proposition from Youtube suggested “mirroring” an iPhone display to a computer with a larger and more convenient display. That certainly improved body position but introduced a video delay just long enough to be debilitating.

Why can’t I just …

Disappointed with the mobile app options, I asked myself the kind of question that engineers ask all the time. “Why can’t I just put a picture up on the computer monitor, aim my webcam at a drawing surface and adjust the opacity of the overlapping windows to create the camera lucida effect?”

After a few internet searches for programs to do this on a desktop computer and finding little beyond the mobile apps that I had previously rejected, I challenged myself again. “What kind of engineer/programmer/artist are you? Just do it yourself! It can’t be that hard.”

It’s not hard at all

I have access to MS Windows and Mac OS X but work primarily on Ubuntu Linux. So that’s where I worked out this solution requiring no special camera lucida program.

Step 1: Find a way to change the opacity of a window.

The xprop utility is for displaying or changing properties in an X-server display, possibly by clicking on the target window. A simple script makes this easy.

#!/bin/bash
# Usage: transparent [% opacity]
# if no argument reset to 100% opaque

if [ "$#" -ne 0 ]; then
export OPACITY=$1
else
export OPACITY=100
fi

echo set opacity to ${OPACITY}%
sh -c 'xprop -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY \
$(printf 0x%x $((0xffffffff * ${OPACITY} / 100)))'

Step 2: Set up a webcam to display the desktop in a window.

I used a small flexible tripod to grasp the top of my monitor and hold the webcam out a bit and facing down to the desktop. Any kind of temporary rig to hold the camera will do, but it should be secure enough that it doesn’t move and break registration once you start drawing. I prefer that this window stays opaque and remains at the bottom.

I use a program called guvcview which provides simple but complete control of most webcams. In particular, it allows locking focus, zoom, “mirroring” the image in the horizontal direction, and “flipping” the image in the vertical direction. Flip and mirror so that hand motions appear correct.

Step 3: Open the image to be traced in a window.

Any image or photo viewer will do. You can access local photos, Google Photos, or just search the web for a picture. Window managers already make it easy to move and resize the window with the image. Run the script above to set the opacity and click on the window with the photo. Something like 50% opacity works well.

Place the image window over the webcam window and adjust the size to match the drawing surface.

Step 4: Draw.

It’s OK, you aren’t cheating. Getting the drawing done easily and quickly lets you move on and spend your time with acrylics or watercolors. It will probably even improve your drawing skills!

The drawing surface is directly in front of the display.

--

--

So the story goes ...

Dennis Director is the author of "A Musing Read" http://www.amzn.com/1981402497 — Common sense advocate. Musings of math, science, imagination, and humor.