JPG distortion, tiling, and artifacts can ruin an otherwise great image. While no technique can truly restore and image, here’s a How-to Geek tip on how to remove and repair JPG distortion and artifacts in a few easy steps.
Nothing shy of a miracle can recover the image data lost when an image is saved in a lossy format like JPG. But with some clever trickery and a little bit of Photoshop magic, you can fix the worst parts of your image and get a better result in almost no time at all. GIMP users, follow along, as this Photoshop howto is GIMP friendly. Keep reading to see how you can finally restore your images!
Fixing JPG Artifacts With Photoshop
JPG is a pretty amazing format, all things considered. But the lossy nature of the filetype can be an ugly mess. Let’s take a closer look at this image.
Without a lot of zoom, we can see a big problem with our image data. Tiling is obvious, and we can see some definite artifacts popping up in the whites of the eye. Let’s take some steps to reduce all of that ugly.
It can be a good habit to make a copy of your background image before making any changes, but in this case, it’s mandatory. Right click your background layer and select “Duplicate Layer.”
On your new duplicated layer, Navigate to Filter > Blur > Smart Blur.
(GIMP users may have to use Gaussian Blur, which can give a similar effect, but doesn’t have the edge detection that “Smart Blur” has.) Reader Alz: Gimp has a “Selective Gaussian Blur” with edge detection, and “radius” and “Threshold” parameters.
These settings worked fairly well for this level of JPG distortion and tiling. If you have more, you can set your “Radius” and “Threshold” to higher settings. Quality settings should be set to “High,” although any setting will work just fine.
Depending on your success with the filter, you may decide to stop here. But it wouldn’t be very geeky of us to stop after just showing you how to use the smart blur filter. Keep reading and we’ll transform this filtered image into a much better final result.
Turning A Smart Blur Into An Image Without Artifacts
Our image clearly has some issues, even with the smart blur. We’ve lost detail and we’re getting some odd pixelation around some of the edges. We have sucessfully blotted out our tiling and distortion, but let’s see if we can’t get the best of both worlds from this image with a little bit of Photoshop geekery.
Create a layer mask on your Smart Blur layer by Alt + Clicking on the button in the layers panel. This will mask out all of this topmost layer revealing the original problematic JPG again.
Grab the brush tool and make sure you fill your Foreground color with white. Your brush should be set to a very soft hardness setting (0% shown above, is fine) with the size set appropriate to the size of your image. Work larger if you’re using a larger image, and smaller if you’re working with a smaller sized image.
Paint white into the image mask in the parts that you want to become smoother and less full of artifacts. Be careful around edges and don’t be afraid to undo and redo your work. Painting with black will hide your topmost layer, while white will make the Smart Blur layer reappear.
Selectively masking the Smart Blur layer will allow you to retain the critical details of the layer with JPG distortion, while eliminating or minimizing the artifacts and tiling.
Selectively changing your brush Opacity in the top options bar can also be helpful. Sometimes leaving some of the detail from the JPG layer can keep some of the texture, while minimizing the gross parts.
Without too much effort put into painting, we can see that our image is beginning to look much improved, despite artifacts and low pixel depth. Let’s look at how our mask looks, just to be clear.
At this point, we’ve only allowed our Smart blur to appear on the parts in our face. Here’s how the layer mask looks by itself. The white parts represent where we’ve painted with—you guessed it—our white brush.
Here’s our overlay, with the red parts representing where the Smart Blur layer is blocked out. Hopefully this makes it clear what you need to be doing with your paintbrush.
Again, it is impossible to recreate the image once it’s been saved in a lossy format, but clever Photoshop trickery can almost always improve it.
Smooth Out Artifacts, But Retain Detail
When you have skies or fields of color, you’ll find that the JPG format will create horrible distortions and textures that clearly weren’t present in the original photograph. Let’s look at one final example to show the usefulness of this trick.
This trick can be very helpful when you have these fields of open color combined with detail (such as this tree), because you can combine the best of both worlds.
Even at this horrendously small resolution, we can combine our smart blur layer with the detail in original JPG. The tree still looks like a tree, and the sky is smooth and artifact free.
And in no time at all, our distortions are cleared up while retaining detail in our foreground object.
So, did we hit the mark with this technique? Do you think you’ll be cleaning up your own images that JPG formats have made all cruddy? Or do you have your own slick Photoshop tricks or techniques for combatting this kind of image distortion? Tell us about them in the comments section below, or simply send us your graphics tips to firstname.lastname@example.org.
Image Credits: Esoteric ~ Socotra Island, Yemen by Martin Sojka, Creative Commons. Tree by Elizabeth Oldham, Creative Commons.
Eric Z Goodnight is an Illustrator and Graphics Geek who hopes to make Photoshop more accessible to How-To Geek readers. When he’s not headbanging to heavy metal or geeking out over manga, he’s often off screen printing T-Shirts.
- Published 02/9/12