Colouring ONLY inside the lines of a layer should be a simple task in even the most basic of image manipulation programs, yet in PhotoShop it was overly complicated and took several steps using masks and multiple layers (or at least the way I was taught was overly complicated). That's why, when I moved to GIMP about a year ago, I suffered big time because I had no idea how to shade a layer without making a mess all over the place. It wasn't until just a few weeks ago when I finally figured out how embarrassingly simple it is to shade a layer without colouring outside the lines. Mind you, like most things, it does take a little bit of setup work first. Here's what you need before you get started:
- GIMP - for this run-down, I'm using GIMP version 2.10.0 on Windows 10 (and works exactly the same on Ubuntu 18.04)
- A layer with an added alpha channel (Right click your layer, select "Add Alpha Channel". If you can't then it's already done!). This is so your layer can support transparency.
Once you've got that sorted out, you're ready to rock and roll! This trick works by taking all the transparent pixels in your layer and locking them so that you can't colour them anymore, so before you move on, add the object you'd like to shade and colour to your transparent layer.
Now in the right-hand pane, where you can see all of your layers, right-click the layer you'd like to shade and select "Edit Layer Attributes". In the pop-up menu that appears, and select "Lock Alpha". This will make it so anything that is transparent in the layer can't be coloured on. It will preserve all current transparency, leaving you to freely colour and shade the object in your layer.
And there you have it! You're free to colour the object in this layer without worrying about colouring anywhere outside the lines (Or transparent pixels, I should say.)
Now that you know the full and total way to lock a layer's transparent pixels, here's the quick and easy way: First, select the desired layer from the right-side menu, and then look at the top of the layer. You'll see the word "Lock", followed by a paintbrush, plus sign with arrows on each tip, and a little square with a bunch of even smaller squares inside. It looks just like a tiny version of a transparent layer. Click that, and you've just locked the alpha channel without having to do any of that crazy right-clicking and pop-up windowing.
That's all there is to it. This was the absolute only thing that was preventing me from totally committing to GIMP over PhotoShop. As an illustrator, it's an absolute necessity to be able to shade multiple layers without "colouring outside the lines". Otherwise, you're going to be erasing for hours and hours and hours and never actually get anything done. I'm so pleased that GIMP saw the need and implemented a quick and painless way to get this done. Now I get to save some precious money from an Adobe subscription and still use a program that's up to the task of keeping up with a complete nut like myself.