Scanning with camera

From The Battle for Wesnoth Wiki

Note: this page is outdated.

All art to be used in Battle for Wesnoth must be in digital form. Art made in real-life techniques must be transferred to digital format, and most often this is done with a scanner, but a digital camera can also be used. In this tutorial we go through the basics for getting good digital photos of paintings and drawings.

The good reasons for using a digital camera instead of a scanner include:

  • You don't have a scanner. If you only intend to use the digitised image as a sketch to draw over, the quality requirements are much lower and often a photograph will do just fine. Even then, though, there's no reason why the quality should be any lower than what you can accomplish.
  • The surface properties, such as crumpy oil paint or metal finish don't work well on a scanner.
  • The image is too big to fit into the scanner. If the scanner lid is detachable, larger images can be scanned in pieces, but then you are left with the problem of fitting the pieces seamlessly together. With a camera you can shoot an image of any size with one shot.

To get a good shot of a painting or drawing there are two factors to consider: how to set the image in front of the camera, and how to illuminate it.

Camera setup

To avoid perspective distortion on the shape of the image, the view angle of the camera should be perpendicular to the image and pointing at the centrepoint of it. Also, to avoid the "fisheye" distortion, where the edges of the image are bulging out, the camera needs to be placed far enough, at least at a distance of several times the width of the image. Usually this is so far that a horizontal setup (that is, the line of sight is horizontal, and the image vertical) is more convenient. Any vertical surface is good for suspending the image, but if you use fixed light sources, you need something moveable. A table turned on its side will do nicely, if you have nothing else.

The camera needs to be fixed to get as sharp image as possibe, so use a tripod if you have one, or at least put the camera on a table, a box, or other stable surface. Zoom in enough so that the image fills most of the view, but it's generally best to do the final cropping on the computer. Set the camera on highest resolution and best image quality (least compression). Also, when digitising colour images, set the white balance to match the type of lighting you are using.

Before starting with lighting, you need to remove any glass covering the image, the surface of the glass is way too reflective (even with the "non-reflecting" types).


The first thing to do to set up the proper lighting is to turn off the flash. The worst way to light the image is to make the light come from the same direction where the camera is. While the view angle should be perpendicular to the image, the best lighting angle is roughly 45 degrees. The reason is, that you want only the diffuse reflection of the light to hit the camera.

Another way to make the reflected light more diffuse is to make the incoming light diffuse. This can be accomplished by increasing the light-emitting surface of the light source. Thre are two ways to do this, the first is to pass the light through a diffuse filter. Anything translucent and milky will do such as a thin paper (baking paper), smoky glass or a muslin cloth. Photography shops sell special filter film for the purpose. Notice that the filter always reduces the light intensity. Another way is to use diffuse reflector, any matte white surface will do, but quite a lot of seemingly white materials actually absorb quite a lot of the light. Specifically good material for a diffuse filter is a plain sheet of polystyrene foam (styrofoam, styrox). It is both highly reflective amd dispersive, and as a ridig yet light material it is easy to suspend (often just prodded on a stick). The reflectivity can be further increased by painting the surface with a silverish metal paint, though it must be water soluble so it doesn't eat away the polystyrene. Aluminium foil can also be glued (with water soluble glue) on it, rubbed in so that it adopts the surface roughness.

Also, in order to get a uniform illumination of the image, the lighting needs to be symmetrical in reference to the view line of the camera. This means that you need, at minimum, two roughly identical light sources, positioned symmetrically on both sides of the camera. We are talking about radial symmetry here, so if you use more than two lights, they need to be positioned on regulal intervals on a circle that has the camera view line as its axis (but usually two lights do just fine).

The image below shows an ideal setup for two light sources (camera is blue, the image red, and the light sources yellow).


Some of you might have gotten discouraged by all the talk about making reflectors and stuff, but things can be done as well with natural light. Windows are natural large area sources of diffuse light and the above illustrated setup can be achieved in a room with two windows on the same wall. Set the image on the centre of the room, facing windows, and put the camera next to the wall between them. There's also plenty of light outside, but direct sunlight is not good, you should only use light reflected from the sky or clouds. The best weather for photographing images ouside is a day when there is a cloud cover just thick enough to make shadows disappear.

Testing your setup

Once you have everything set up, you can run a test by taking a picture of a white sheet of paper the size of your image. Upload the picture into your computer and open it in a image processing program, such as GIMP or Photoshop. Using whatever tool available for making rectangles, you should be able to draw one that pretty much equals the shape of the paper, if your setup is correct. If the edges of the paper seem to bulge outwards, your camera is too close. If the shape of the paper looks like a trapezoid (opposite edges are not the same length), the angle between the view line and the image is not 90 degrees and/or the camera is not pointing at the centre.

Next you must use the colour picker (pipette) tool to check that your lighting is uniform and that the exposure and white balance match your lighting. Pick a value at the centre of the paper and close to each corner. The values should be roughly the same, and if not, your lighting is not symmetric enough. The values should also indicate no colour, that is the red, green and blue values should be roughly equal. If not, the white balance is not set right. The values should also be as close to full white (255,255,255 in RGB) as possible, but to avoid overexposure, slightily below it (because overexposure is capped to 255,255,255, you can't tell it from values that really are full white). If the values fall significantly short of 255, you need a higher exposure setting for the camera, or more light.

It is possible that no single setting of exposure will give you enough resolution in luminosity (dynamic range) in both the lighter and darker parts of the image. In these cases, the technique for extending dynamic range presented in another tutorial will be applicable here as well. Obviously, any other postprocessing photo enhancement techniques can also be applied, but usually they also degrade the image quality in some way (e.g. intoduce posterisation or noise), so it's always worth the effort to make the image as good as possible already in the camera.

This page was last edited on 2 September 2021, at 22:51.