Saturday, February 27, 2016

A quick way to clean up screenshot compression artifacts in the GIMP

People love sharing things online. Screen captures from Twitter, Facebook, Google+, and a multitude of other sites are regularly saved, edited, resized and resaved.  A lot of the time, this is done to files that use lossy compression - such as JPEGs.

Multiple saves of files with lossy compression can lead to compression artifacting. Compression artifacting creates a serious distortion of all sorts of different types of digital media that uses lossy compression; however, I'm referring to images right now - and more specifically screenshots of text on a white background. This is illustrated in the image to the right, which someone shared on Facebook (I do not have permission from Cloyd Rivers to use this, but it is all over the place, so I'm looking at this as educational fair use).


The compression artifacting in that image is quite distinct.  I want to clean it up some, in as simple a manner as possible, using the GIMP.  There are actually a number of ways to do it, but I'm going to show one that generally works pretty well for me.


Using the original JPEG, and a couple/few duplicate layers with different modes, I can clean it up significantly without having to fiddle around with selections and drawing tools.


The process is remarkably simple.  You open the original file that has the artifacting, in this case, I changed the color space to sRGB.


 Now, just make two or three duplicates of the layer, the first one or two layers should use the mode "Screen", and the final layer should use the mode "Hard light" (give "Darken only" or "Multiply" modes a try also, to see if they give a better effect than "Hard light").

This is how my final image comes out. I can actually clean it up even more without too much effort, but it's much more pleasant to the eye even as it is.
I then export the image as a PNG, to avoid the whole lossy compression issue.

Pretty simple huh?


No comments: