Removing Backgrounds With GIMP

Good Morning from my Robotics Lab! This is Shadow_8472, and today I am editing pictures for my church’s photo directory. Let’s get started!

My Background

I first learned the basics of photo manipulation in high school using Photoshop. Pictures can be split apart, remixed with other pictures or original (hand drawn) elements with a wide variety of tools, and sent back out for use elsewhere. The whole operation is organized in a series of layers with their won operations.

Photoshop is not a bad program, but ever since Adobe moved their product to a subscription model, service has have improved for people who use their products consistantly. But for people like me who only need it once every few years and at a moment’s notice, monthly or yearly payments are a terrible investment. I own an old copy of Photoshop, but even then the liscence is a pain to move from computer to computer — and if memory serves, it’I’m limited to the total number of computers it can ever rest on.

GIMP (GNU Image Manipulation Program) is a comparable, free and open source alternative. And in true Linux fashion, it focuses on a small core feature set to serve the vast majority of users’ needs while specialized functionality can be added with extensions. Contrast that with Photoshop loading every tool imaginable for everyone who won’t use but a quarter of them at most. In short: Photoshop has more polish, but GIMP is easier on system resources.

Selecting and Removing a Background

My church produces a photo directory every few years. Families grow, and pictures need updating. I was given a number of pictures and was expected to remove their backgrounds or else turn them white. Photoshop’s tool of choice would have been the quick select tool, but GIMP won’t have a perfect counterpart for this simple tool until GIMP 3.0. Instead, I taught myself the foreground select tool, which I would describe as resistant to learning by trial and error.

The foreground select tool has multiple phases. In GIMP 2.10 specifically, you start with a selection loop, overestimating your subject. You can use line segments or hand drawn boarders, whichever you deem most reasonable at the time. Endpoints are freely adjustable once you’ve closed the loop.

Hitting Enter will put you in phase 2. Here, the whole picture takes on a blue tint (The color is adjustable, but I didn’t learn how). The goal here is to paint in your clear foreground, heavily tinted background, and a lightly tinted buffer between them called “unknown” or “unknown pixels.” Tool options let you switch between what zone you’re painting.

Here, more than anywhere else, it’s particularly picky about keeping on task. I lost about two hours total because I did something just a little too unrelated and the foreground select tool sent me back to phase 1 with no way to undo. It is best to save other tasks in the workflow for later, like adding an alpha (transparency color) channel or duplicating/hiding the original picture layer for quick reference.

Phase 3 will “[calculate] the alpha value of unknown pixels” referring to your boarder zone. It provides a preview of exactly what you’re selecting and lets you make further adjustments, but it will recalculate everything each paintbrush stroke you make. I recommend finding the small dialogue box that lets you disable the preview, effectively reverting to the more economical phase 2. By going back and forth between these two phases, you can tell where the algorithm understands your selection and where it needs more help. Hitting one enter while in phase 3 will finalize your selection.

Training Family

One of the more rewarding parts of this experience was teaching my father this tool, though there were unique challenges. At one point, he was having frustrations getting the tool to cooperate. I had worked with this tool using two or three computers, but his description of what was happening sounded alien to my experiences.

I took a look at his workflow, and GIMP was skipping straight from what I’m calling phase 1 to phase 3, forcing him to use long strokes or face tons of extra recalculation time. Long story short, while I was trying to make his tool icons larger, I found he was on GIMP 2.8, the latest available in the Linux Mint repositories. The GIMP download page directed me to a GIMP 2.10 flatpack installer. The system still prefers GIMP 2.8 when unspecified, but he figured out how to proceed, so that’s a tech support topic for another day.

Color to Black and White

Later on, the software for the directory was making some pictures way too dark. Photoshop has a layer filter for this exact use case with six sliders to adjust different color ranges. GIMP doesn’t include any layer filters, but I was able to make a crude approximation of this tool. Just know there may be a better way to do this and I don’t know it — plugin or otherwise.

To make the perfect black and white version of a color picture, I would start by adding a white background and merging layers if necessary. Next, I menued over to an option to decompose the color channels to a new document. With each layer in grayscale, I added another white background and used Color to Alpha on the red, green, and blue color channel layers. I then adjusted the opacity of each layer until I had a result I was happy with.

Each picture was its own challenge. Most times, I would have one layer carrying most of the data while reducing the other two dramatically. Too little color data, and the picture would fade. Too much, and it would go dark. I targeted a mix where the picture would pop and my eye would relax a little while looking at it.

Takeaway

Both GIMP and Photoshop are wonderful pieces of software in their own rights. I’ve had a class on Photoshop, so of course I’m going to find it easier to navigate that program, even if it’s been years. Despite my slim requirements of advanced photo editing, GIMP’s slim feature set slimmed out a feature or two I miss.

Final Question

Have you taught yourself both Photoshop and GIMP? Which is harder to learn?

Leave a Reply