Category: Software

Eraser Tool Not Working in GIMP

Eraser Tool Not Working in GIMP

Why in the world would the eraser tool in GIMP paint a color instead of erasing? Sometimes quirks like this seem totally inexplicable, but if you know why it’s happening it actually makes sense… sort of.

If the eraser tool is painting instead of erasing, here’s what’s going on and how you can fix it.

Skip To

Why GIMP’s Eraser is Painting Instead of Erasing
Fix Eraser Painting Instead of Erasing
The Gray Checkerboard Pattern
Saving With Transparency

Why GIMP’s Eraser is Painting Instead of Erasing

Each pixel in your image has color information stored in a color channel. A channel is just a segment of color. In RGB mode, those channels are red (R) green (G), and blue (B). Pixels can use combinations of these channels, basically mixing colors to make other colors like you did in elementary school. Combining channels in different ways basically gives you every color of the rainbow. There are other color models like CMYK, but they work similarly. A set of basic colors can be mixed together to make other colors.

So you have a huge amount of colors to work with, but transparent pixels aren’t possible yet. Without transparency, the only way to “erase” using just R, G, and B channels is to replace the image pixels with a solid color. The color used to replace pixels is kind of arbitrary, so GIMP will use the “background color” to replace your image pixels as a default. That’s why GIMP’s eraser sometimes paints with black, white, or another color depending on the background color you set in the Toolbox.

The first layer in any JPG image you open in GIMP does not support transparency, because JPG’s themselves do not support transparency. That means any time you open a JPG in GIMP and try to erase, you’ll see this eraser not erasing problem. PNG files do support transparency, so if you open a PNG in GIMP the eraser tool will work as expected right away.

If you want that first JPG layer to support transparency you’ll need to add a “alpha channel”. In GIMP, alpha just means transparency. So in addition to R, G, and B, the alpha channel gives your pixels information about transparency to work with. The ability to make transparent pixels is what allows the eraser to really erase.

How to Fix GIMP Eraser Painting Instead of Erasing

add an alpha channel when the eraser tool isn't working in GIMP

Here’s how you add an alpha channel to a layer in GIMP:

  • Find the Layers Dialog. If you don’t see it, go to Window > Dockable Dialogs > Layers. If the Layers Dialog was already open it will blink. If it wasn’t open, it will open in a small window.
  • Now, in the Layers Dialog, look for the correct layer thumbnail. It will look like a mini version of the image you have open, or the layer you want to work on.
  • Right-click (or alternate click using your preferred method if you’re on a Mac) on that layer thumbnail. A menu of options will appear.
  • Choose “Add Alpha Channel” from the list of options.
  • The Alpha Channel will be added to your image, and the eraser should work as expected now.

Erasing with Transparency – The Gray Checkerboard Pattern

gray checkerboard pattern with eraser tool in GIMP

Now that your eraser is erasing and your pixels support transparency, you’ll be able to see through your erased parts of a layer to the layer below. It’s like you have a stack of papers, and erasing rubs holes in a sheet of paper so you can see what’s beneath it.

Makes sense… but when you only have one layer, you’ll see a weird gray checkerboard pattern everywhere you erase. It’s not exactly attractive, and it can be kind of alarming when you first see it. I mean, I know I really don’t want that pattern showing up in my image.

Thankfully that pattern isn’t actually part of your image. It’s there because you can’t see transparent pixels, so when there’s nothing underneath a layer GIMP has to show you something to indicate that there’s basically a hole in your layer. It could show you a solid color like white, but then you wouldn’t be able to tell the difference between holes and where you actually painted with white. So it uses this really obvious checkerboard pattern to make it clear where transparent pixels are.

This is a standard way of representing transparency, and you’ll see it in other image manipulation programs like Photoshop. You’ll even see this pattern used to represent transparency in menus and tools. You can see a little gray checkerboard icon next to the “add alpha channel” option in the layers dialog.

This pattern is not saved in your image. If you save using a file type that supports transparency (like PNG), your transparent pixels will actually be transparent and they’ll allow anything that’s beneath that image to show through.

Saving Images With Transparency

Final note about transparency in GIMP:

Adding an alpha channel won’t change the fact that JPG’s don’t support transparency. If you save your new GIMP image as a JPG, those transparent pixels will be replaced with your background color again. If you want to keep the transparency, you’ll need to save your image as a PNG.

I hope that clears up some of the unexpected transparency related quirks you’ll find in GIMP and other photo editing programs. The big takeaway is, if your GIMP eraser isn’t erasing and it looks like it’s painting a color instead, you probably just need to add an alpha channel to that layer.

Raw Photos In GIMP

Raw Photos In GIMP

This photo was very underexposed, but because I shoot RAW, I was able to bring it back to life.
This photo was very underexposed, but because I shoot RAW, I was able to bring it back to life.

Hi! This post was written as extra info for folks reading my book, How to GIMP so It’s got a lot of extra information about what RAW files are and why you would want to use them.

But if you just want to know how to work with RAW files as a GIMP user, this post will be helpful for you too.

Skip to the sections you’re interested using these links, or read the whole post to take it all in.

What’s RAW and why should I use it?

How A Camera Records Light

When your digital camera takes a picture, it’s really just recording the light that hits its sensor. In some ways, the camera physically limits or transforms that light. The lens aperture limits the amount of light that hits the sensor and determines how much of the scene is in focus. The shutter speed also limits the amount of light hitting the sensor, and effects whether moving objects blur or stay sharp. Those physical limits are set in stone as soon as you snap the photo.

But, there are a lot of ways in which your camera interprets the light that hits its sensor that aren’t a matter of physical limitations.

Here’s an example: The white balance of a picture isn’t a matter of a physical transformation of light, but the the camera decides what color to render pixels in the photo based on its interpretation of the scene. Whether you chose a white balance setting like “daylight”, or “cloudy”, or let the camera guess the light by setting the white balance to “auto”, the camera will do its best to make everything the right color.

Why JPG’s Are Hard To Post Process

When your camera records a JPEG photo, the way your camera decided the light should be transformed into pixels is locked into that JPEG. It doesn’t contain any information about the way the light was hitting the sensor when you hit the shutter button. It’s just a collection of “dumb” pixels.

Sure, you can use something like GIMP or Photoshop to adjust the pixels in your JPEG. But if you’ve ever tried to brighten super dark shadows in a photo only to end up with an indistinct blob of gray, you know that those dumb pixels are missing a lot of critical information. If pixels in the shadow of your image are totally black, no amount of adjustment is going to bring details back because GIMP and Photoshop don’t know anything about what was actually in the shadow. It just sees a group of black pixels that you want to make lighter. Hence, the gray blob.

But a RAW file is totally different. It’s literally the raw information about the light that your camera recorded with very little interpretation imposed.

The RAW file also contains information about the settings in your camera when you took the photo, so when you open it in a RAW editor you can see the way the photo would look as you shot it. But all of the information the camera had about the light hitting the sensor in that moment is in there too. What that means for you is that you can open that same photo in a RAW editor and literally change the white balance of the photo after you’ve taken it.

Taking pictures in the RAW format opens up a lot of opportunities. You can change white balance after you take the picture to make colors more accurate, and you can adjust the exposure of the image really easily. The best part is, these changes are non-destructive. You can go back to the original at any time.

The original RAW file itself is never really edited. Instead, the changes you make in a RAW editor (like UFRAW, Adobe Camera RAW, or RAWTherapee) are stored in a ‘side car’ file. This file tells the RAW editing program what settings to apply every time you open the RAW file, but it doesn’t permanently apply the settings until you export the file to a format like JPG. Even then, the original RAW file is still untouched.

In fact, if you delete the RAW Sidecar file, the RAW image will go back to its original state when you open it in the RAW editor, because there’s nothing to tell the RAW editor which settings should be applied. Because changes to RAW images are only stored in a side car file, you can go back and re-edit the original RAW file at any time without loss of image quality.

Can GIMP handle RAW photos? How GIMP users can take advantage of RAW.

Can you use RAW files as a GIMP user? Yes.

Can you work with RAW files directly in GIMP? No.

In order to work with images you shot in a RAW format in GIMP, you’ll need a RAW converter to first change them to something that GIMP can read, like TIFF or JPG.

That’s not a GIMP quirk, it’s a RAW quirk. Even if you were using Photoshop, you would have to first work with the file in something like Adobe Camera RAW, and then convert the file to something like a JPEG or a TIFF that Photoshop can recognize to continue working on it.

Adobe has been busy making its whole ecosystem more connected, so it really feels like you can just open a RAW file in Photoshop. You’re going to miss out on that seamless experience in GIMP. But you definitely still can use RAW files if you’re a GIMP user. You just have to process them first with a RAW processor/converter program.

Once you convert the RAW file to a JPG or TIFF, those settings from the sidecar are permanently applied to that JPEG or TIFF file. When you open the photo in GIMP, it will recognize the image just like any other JPG or TIFF. You can’t exactly undo the changes you locked into the JPG or TIFF, but the original RAW file and sidecar file will still be on your system just in case you want to tweak the settings, or even start over.

Free RAW converters to use with GIMP

If your camera can shoot RAW photos, it may have come with RAW conversion software. If it did, I recommend using that software for your RAW editing process. But, if your camera didn’t come with this software, there are some free options available. One of these options is called UFRAW, and it’s designed to work with GIMP.

How to install a free RAW converter

The UFRAW Window. Click to see a larger version of this image.

For Mac

Good news everyone! If you downloaded GIMP from this site UFRAW may have come with your GIMP installation. If that’s the case, you won’t have to do anything. To check if you’ve already got UFRAW installed on your computer, follow these steps:

  • Open GIMP.
  • Go to File > Open in the Main Menu. The Open window will pop up.
  • Navigate to any RAW image file you have, highlight it, and click Open.
  • If a funky looking window opens up with your picture in it (looks like the image above), you already have UFRAW installed.

If you get a warning that you can’t open the RAW file with GIMP, you will need to install a separate RAW converter.

Another free option is RAWTherapee. You can find the download here, and instructions on using it here.

Once you download RAWTherapee, double click the ZIP file to open it, then open the DMG file to run the automatic installer. You can drag the RawTherapee icon into your Applications folder to keep RAWTherapee handy when you need it.

For PC

  • Make sure you have GIMP installed.
  • Then, download UFRAW from this link.
  • Open the package, and follow the instillation instructions.
  • Now, open GIMP, and go to File > Open in the Main Menu.
  • Navigate to any RAW file, highlight it, and click Open.
  • Your RAW image will open in a new, funky looking window. That’s UFRAW. Now you can start editing!

How to Use UFRAW

There are a ton of options and controls in this UFRAW window. It’s such a powerful tool, I could easily write a book on just UFRAW! Thankfully, there’s already some pretty good documentation available. So, instead of re-writing all of it here, I’ll send you to the UFRAW Users Guide for more information on how to use it.

Have Fun! And let me know if you have any issues. I can’t offer official support for UFRAW, but I can try to help in some cases, or direct you to someone else who can help more.