Let’s say you have a small image and you want to make it big. Perhaps you lost the larger version, or perhaps there never was a larger version. If you go to a normal photo editing program, like Photoshop, and try to enlarge the image, you’ll probably be somewhat disappointed.
The editing program is likely to use either bilinear or bicubic interpolation to create the missing pixels in the enlarged image. The problem is that they’re looking rather naively at just the neighboring pixels when they create a new pixel. Obviously, they can’t magically “enhance” their way into adding new information to the image, but neither are they being clever about using what data is available. Thus, the enlarged image is rather soft and blurry.
So what can be done? Unfortunately, Blurity isn’t well-suited for enlarging photos. The problem of enlarging photos, called “superresolution”, is related to the problem of removing blur from photos, called “blind deconvolution”, but not in a way that makes Blurity useful for enlargement. Instead, we need a different type of specialized tool.
One of the most interesting and successful approaches takes advantage of the fractal nature of a natural image. In particular, visual elements are repeated within the image at different scales. This is important for two reasons.
First, the visual elements are likely to be repeated within the image at sub-pixel misalignments. In essence, the higher-resolution version of that repeated visual element has been sampled multiple times, which provides enough data to reconstruct a model of the higher-resolution visual element without directly observing it. The extra sampling also enables the removal of noise and compression artifacts.
Inferring the latent high-resolution version of the patch from a variety of slightly differently sampled lower-resolution versions of the patch is the essence of classical superresolution.
Second, the visual elements at different scales can be used directly in the resized image. For example, a circle might appear repeated in the small version of the image at multiple scales. A large scale of that circle could then be used in the enlarged image as a replacement for a small scale circle.
At the moment, most of this technology is limited to the lab. A paper by Glasner et al. called “Super Resolution From a Single Image” includes some great examples of state-of-the-art image enlargement.
If you’re not in the lab, never fear. There are several products that attempt to do the same thing. (Disclaimer: bleeding-edge technology like this tends to be finicky, and these algorithms don’t always produce good results.) Some options to consider:
Happy enlarging, and don’t forget Blurity if you just need to remove some blur.
Blurity is back! The world is still full of blurry photos, and there still are no other decent blur removal tools available to consumers.
For this round, Blurity is an application that runs on your PC. Specifically, your Windows PC — a Mac version will be released if it looks like there’s sufficient demand.
What happened to the web version? In short, the market happened: nobody wanted web-based photo blur removal. A minor pivot, but a pivot nonetheless!
Whenever the topic of photo deblurring comes up, there are inevitably comparisons to and questions about Photoshop’s built-in tools. As discussed in an earlier post, things like unsharp mask do help to improve the apparent sharpness in certain situations. In fact, for out-of-focus blurs, the results produced by unsharp mask and those produced by Blurity can be quite similar.
Not so for motion blur. Blurity blows away the other approaches when removing motion blur.
For motion blur, unsharp masking and tools like “Smart Sharpen” are nearly useless. They attempt to improve local contrast to increase perceived sharpness, but that trick doesn’t work very well with motion blur. Even in Smart Sharpen’s motion blur mode, it cannot restore the detail obscured by the blur. Blurity, on the other hand, creates an actual model of the blur, so it is able to adapt to complex movements and transformations.
Here’s a real-world image that suffers from motion blur:
I captured this image of my Seiko watch and favorite mug on my desk with my Canon A1100IS camera. (Full disclosure: I switched the camera’s built-in optical image stabilizer off in order to get a good demonstration photo. Also, the image has been rescaled to be 3.0 MP to improve blur modeling, which is a trick I’ll cover in a future article.) It’s about a half-second exposure, and the blur is obviously quite severe.
Ordinarily, you might turn to something like Photoshop to try to fix a photo like that. Ok, we’ll give that a shot.
Here’s the blurry image sharpened with Photoshop’s Smart Sharpen filter (motion blur setting, 64px length, 135 degree angle, 100% application):
That didn’t help much. The watch face is still unreadable, the mug is still fuzzy, and the photography gods are still crying.
We can do better. We have Blurity.
Here’s the same image again, this time deblurred with Blurity:
The difference is even more stark when zoomed in. Blurity managed to recover an impressive amount of detail:
The text on the mug is clear, and the second-marker hashes are crisp on the watch face. It’s even possible to read the numbers on the sub-dials on the watch face and the date in the watch’s date window (it says “3” because I forgot to set it forward at the end of February). Isn’t that amazing?
For comparison, here’s a close-up of the original blurred watch face next to the Blurity deblurred watch face:
I think you’ll agree that Blurity handled this image much, much better than Photoshop.
Not all blurs can be removed, but if any automated tool can do the deed, it’s going to be Blurity. And of course, it’s always free to preview the deblurring.
With a name like “unsharp mask,” it would be reasonable to assume that such a thing would make a blurry image even blurrier. The opposite is true, of course: unsharp mask is a popular technique for improving the perceived sharpness of photos. It works by increasing the edge contrast — the “acutance” — of an image.
But what’s going on when you slap “Unsharp Mask” in Photoshop?
Let’s walk through an example. Say we have a have a slightly soft image of some text that we want to improve:
The first step for unsharp masking is, surprisingly, to make the image even blurrier. Here we apply a 1 pixel Gaussian blur to the blurry original:
Next is the key to the technique. We want to use the extra-blurry image as a mask.
Subtract the really-blurry image from the somewhat-blurry image, and we get…
…a black rectangle. Not really; there are actually difficult-to-see lines roughly tracing the edges of the letters. Here’s the difference result again, this time level-shifted to be more visible:
Set that aside for a moment, and make another copy of the original blurred image. To this image, increase the contrast significantly.
It’s sharper, sure, but the overall colors have been shifted. Where we once had shades of gray everywhere, we’re now left with just black and white. This would be even worse if it were a color image. Not good.
Intuitively, we want to use the high-contrast version of the image near the edges, but we want to use the original version everywhere else so that our entire picture doesn’t get the high-contrast look. This turns out to be easy: just use the difference map from a couple of steps ago as a mask for the high-contrast version of the image. Layer the masked high-contrast image over the original image, and…
Voila! A sharpened version of our image. Note that there is a bit of a halo effect here around the edges due to overshoot, but applied conservatively, unsharp masking can provide a pleasant crispness to many images and even fix slight blurs.
Major blurs require a different approach, but we’ll save that for another day.
Imagine this: you’re trying to take a photo of your friends with your camera, but the light is dim and you can’t use a flash. The camera seems to focus successfully, so you click the shutter, but the resulting photo is totally blurry. Oh no! Sound familiar?
What you’ve just experienced is known as motion blur. It’s caused when either your camera or what you’re photographing moves during the exposure.
Motion blur is most often a problem when the light is dim. Your camera compensates for the reduced light levels by taking a longer exposure. The longer the exposure, the more time there is for movement, and if there’s movement, there’s blur.
Modern point-and-shoot cameras and DSLR lenses incorporate image stabilization systems which can eliminate some types of motion blur to a certain extent, but the best strategy is still prevention.
Here are some tips for reducing motion blur:
- Use a faster shutter speed: The shorter the exposure (i.e., the faster the shutter speed), the less time there will be for movement. A rule of thumb for photographing stationary objects is to use a shutter speed at least as fast as the reciprocal of the effective focal length. For most point-and-shoot digital cameras, that means a shutter speed of at least 1/30 second at wide angle, and at least 1/150 second when zoomed all of the way in.
- Add more light: If it’s possible to add more light to the scene, that will allow you to use a faster shutter speed.
- Increase your camera’s sensitivity: No, this doesn’t mean you need to teach your camera to “actually listen” to you. It means that you can try increasing the ISO sensitivity level, which is somewhat analogous to turning up the “volume” on its light sensor. If your camera is set to 200, try 400. If it’s set to “auto,” try a higher manual value, perhaps 800. Be aware, however, that there’s a trade-off: the higher the sensitivity, the noisier/grainier the photos will be, which can result in blur of a different sort.
- Remind everybody to stay still: If the problem is not that the camera is moving, but rather that the people in the photo are moving, then don’t be afraid to tell them to stay still. Depending on your camera, they might need to remain stationary for some time before or after they hear the camera click in order to prevent blur.
- Use a tripod or other brace: If you can hold the camera still using something like a tripod, that’s a win. If you don’t have a tripod, any other solid object can serve a similar purpose. Tables, fence posts, and car hoods are some often-convenient options.
- Hold the camera tight to your body: Your body will experience less movement than will your hands. Therefore, you can use your body as a sort of crude brace. Grasp each side of your camera with your hands, then bring your arms in and hold them tightly against your chest. Alternately, turn your head to the side and hold your camera on your shoulder. You’ll be able to frame your image while enjoying a relatively solid bracing surface.
Have other ideas? Feel free to add them in the comments!