Thursday, January 30, 2014

Censor An Image In GIMP

Maybe it's your license plate number. A friend who wants to keep their picture private. Someone's email address that you want to hide in a screenshot. Cropping isn't the most effective way every time, and sometimes you need to censor it neatly and unobtrusively. There's a bunch of ways to do so - I'll try to help you find the one that fits you best.

I'll use a public domain image of an F-35 with identification markings on the tail wing. Let's try to (for whatever reason) hide them. Open your image up in GIMP.

F-35 Public Domain

Censor Bars (Black Box)

This is the simplest way to censor an image in GIMP. Using the Rectangular Select Tool, draw a box around the part you want to cover. Then, grab the Bucket Fill Tool, select your colour,  and set it to "fill whole selection". If you leave it as "fill similar colours", only a specific colour range will be slathered in paint.

Censor Bars (Black Box)

Since the entire area is covered entirely, this is probably the most secure way to censoring an image. In extreme cases, it actually is possible to "unscramble" effects such as swirls in order to reconstruct the hidden content underneath.

Blur

Select the area like you did above, but this time go to (Filters → Blur → Gaussian Blur). Turn on the preview, and adjust the "Blur Radius" to control its intensity. Lower values look more natural, but they make it possible for the viewer to guess what's underneath. Higher values provide better security and as a result more distortion.

GIMP Gaussian Blur Dialog

Feathering the edges (in the Rectangle Select Tool options,  tick "Feather Edges") might create a smoother look. Adjust the level of feathering to suit your tastes.

Gaussian Blur With Feathering
25px feathering, 20px blur radius

Pixelization/Mosiac

 Again, select the part you want to hide. This time, activate the "Pixelise" filter by going to (Filters → Blur → Pixelize). Set the size of the pixels using the control panel - the larger they are the more obscured the area will be. With this technique, the use of censorship is extremely obvious.

GIMP Pixelize Dialog

Object Removal/Overpainting

This is the hardest and most effective technique. If done well, you can't tell whether the image was edited or not. Your goal is to completely hide the content by removing it from the picture entirely, and take care of the empty space with some filler.

First, use accurate selection tools (I recommend the Free Select Tool and a steady hand) to isolate the area with a closed loop. A bit of feathering is essential (it's in the toolbox) and anti-aliasing should be turned on. Due to the line in the middle of the tail, I have split the job into several parts.

GIMP Selection With Feathering
Selection with feathering @ 2px

Next, "heal" the selection (Filters → Enhance → Heal Selection). Since I'm fairly close to the boundaries of the tail, I used a sampling width of 10px and only sampled from above and below (sampling will occur on the navy blue edge if I sample from all sides). The result is fairly decent already and is unnoticeable if I zoom out.

GIMP Heal Selection

With help from the Clone Stamp Tool and basic retouching, you can polish it off. In the image below, I used varying levels of opacity for the Clone Stamp to create realistic gradients, and ran some selective blurs to even things out. Sharpening it afterwards adds some artificial grain.

Censorship - Object Removal

Ten minutes later and it looks fine at 100% sharpness (that's what I took the screenshot at). If you zoom in closely there's still some imperfections left, but that can be taken care of with a bit more careful work. For low-res jobs, you can't tell that it's been changed.

No comments:

Post a Comment

Offensive and inappropiate comments will be deleted. Digitally Free is not responsible for content uploaded by users.

Back To Top