Page 1 of 1

How to Darken a B&W Image

Posted: 10 May 2020, 13:53
by rcull
I am not sure whether the problem I am having with light B&W images is related to camera exposure or lighting or something else.
The image on the left is with my DYI scanner running two Cannon 2200s. The one on the right is with my flatbed. I would like the result from my DYI with the 2200s to appear more like the one from the flatbed. Any suggestions as to what I should look at or play with? Lighting, camera settings,...


Re: How to Darken a B&W Image

Posted: 11 May 2020, 13:21
by duerig
For camera control, you can try adjusting the shutter speed. That is the best way to control how much light gets to the camera on these cheaper point and shoot cameras. Longer shutter speed means more light. And if there is too much light, the whole image gets washed out.

However, even with ideal shutter speeds, you may find that the contrast is not as good as you would like. There are two main ways to handle this in post-processing.

One is to renormalize the image in some way. Usually the white areas aren't 100% white and the black areas aren't 100% black. So you can spread the various shades of gray across the whole spectrum instead of the limited range that the photo has on its own.

The other is to 'sharpen' the image in some way. In Marker Crop, I do this with a Gaussian Blur. Here is the opencv code:

var blurred = createMatrix(image, sharpenBlurredData);
cv.GaussianBlur(image, blurred, new cv.Size(5, 5), 3);
var result = createMatrix(image, sharpenResultData);
cv.addWeighted(blurred, -0.5, image, 1.5, 0, result);
return result;

If you are using ImageMagick or some other tool/library that allows fine-grained image transformations then you can do the equivalent. Or if you are using a more high-level tool then look for 'sharpen' or contrast options.

Note that in general, the best way to solve something like this is with better cameras/equipment. A flatbed scanner almost certainly gets better quality images (higher DPI, better contrast, etc.) if it is feasible. But it is just not feasible with books where you care about getting into the gutter and need to preserve.

-Jonathon Duerig

Re: How to Darken a B&W Image

Posted: 07 Jun 2020, 13:54
by rcull
I have played with the shutter speed to darken the images. It seems to work.
My lighting is 2x40 watt incandescent bulbs. I was using a shutter speed of 30, and have moved to 125. The images look dark on the pi capture screen, and on the Scan Tailor screen. But, Scan Tailor does an excellent job of processing them and they look great when finished.