Files
hpr-knowledge-base/hpr_transcripts/hpr3330.txt
Lee Hanken 7c8efd2228 Initial commit: HPR Knowledge Base MCP Server
- MCP server with stdio transport for local use
- Search episodes, transcripts, hosts, and series
- 4,511 episodes with metadata and transcripts
- Data loader with in-memory JSON storage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 10:54:13 +00:00

139 lines
13 KiB
Plaintext

Episode: 3330
Title: HPR3330: A Layer Mask Project
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr3330/hpr3330.mp3
Transcribed: 2025-10-24 20:55:48
---
This is Haka Public Radio Episode 3334 Friday 7th of May 2021.
Today's show is entitled A Layer Mask Project and is part of the series GIMP.
It is hosted by AYUKA and is about 16 minutes long and carries a clean flag.
The summary is, we apply our knowledge of Layer Mask to create a project.
This episode of HPR is brought to you by archive.org.
Support universal access to all knowledge by heading over to archive.org forward slash donate.
Hello, this is AYUKA. Welcome to you to Hacker Public Radio and another exciting episode.
Continuing our GIMP series and what we're going to do today is we're going to do a little project.
We're going to do something involving using Layer Masks in combination with a few other tools because that's how you do things.
It's a good way to learn how to integrate all of these things by trying to accomplish a specific goal.
Most of the things you do in GIMP do require multiple tools to carry off and you need to learn how to string together various image modifications to get the desired results.
Anytime you want inspiration or new ideas check out YouTube. I get a lot of good ideas there.
For instance, there's a link in the show notes for this as a fellow named Chris Parker has a channel called Parker Photographic.
He's been doing a series of tutorials on text effects in GIMP. I've enjoyed it a great deal.
I've learned a lot from it, even though I have no present need to do any of these particular effects.
They're still valuable to me for showing me how he uses the GIMP tools.
I think that's a good thing to do.
Again, link in the show notes, check out Parker Photographic.
For this project, I decided to use an outdoor image.
Again, I went back to the Wikimedia images site that we've talked about so many times.
This time, I checked out the US Fish and Wildlife Service, which has a National Digital Library.
All of the images I looked at were public domains, so I could use any of them freely.
When you select an image to download it, they give you the license information on the page.
I've got an image of that on my websites that you can see. It's under the heading rights. It says public domain.
Cool. You text dollars at work if you're an American.
But it's even free for people in other countries.
I selected an image. It was an image of mountainous rocky terrain.
What I wanted to do was replace the sky with something completely different.
I should let me use a number of tools. Note that this is a JPEG image.
And thus, it does not have an alpha channel.
So when I open this in GIMP, the first thing I need to do is add an alpha channel.
So right click on the layer in the layer window and select add alpha channel.
Now to replace the sky, there are several possible ways to do this.
First of all, you could create a layer mask and freehand draw a black on the sky, making it transparent.
Well, that would work, but you got to be really careful about detail at the horizon.
To get it right, you would need to zoom in to the image and use a small brush.
And that might take a bit of time. It is definitely doable.
But to see what I mean, just use the zoom.
The key to press to get zoom going is Z.
And then you can use plus and minus keys to zoom in or out as needed.
If you zoom in, you are going to get a highly pixelated image.
And because of the anti-aliasing, you have decisions to make about which pixels to erase.
Anti-aliasing is a technique for eliminating jagged edges on boundaries, which is nice.
But it means that there are a lot of pixels that are sort of shading their way from one thing to another.
And so, you know, where does the boundary stop is a question you have to answer?
So, doing it this way is a lot of work.
So, there's got to be a better way.
Well, you could use one of the select tools.
Given the rough horizon boundary, probably your choices are free select or foreground select.
Now, first thing I would do in line with what we talked about before start by duplicating the layer.
So, if this doesn't work out, I can just delete the duplicate and still have my original image.
Now, to duplicate the layer, go to the bottom button bar and select the button that has two overlapping images on it.
And remember, you can also just hover over each button and the tool tip is going to tell you what it does.
So, if you click on that button, you get a duplicate.
It's a good idea to start naming your layer so you can keep track of what you're doing.
Now, to rename a layer, just double click on the layer name and it becomes editable.
So, I named my original image original and my duplicate working copy.
I added a layer mask to the working copy and turned off visibility for my original.
Now, my layer window has got two things going in it.
And I've got a screen capture image put up on my website if you want to double check any of that.
Now, since the last thing I did was turn off visibility, the original layer is the active one.
It's the last one I did anything with and it has a white border around it.
So, we need to click on the layer mask to make it active.
Then, to use the selection tool, I found it useful to zoom in two notches before doing this.
Remember that you're setting a series of control points around your selection to define the area and you need to connect back to the first point.
This will mean continuing the path of the selection outside of the image boundary.
You've got to create a completely closed loop, so to speak, that you're selecting.
So, you'll go across the image from one side to the next and then you're going to go around the outside and back to the starting point.
And you'll know you are at the first point again when instead of the empty circles you get from control points,
you suddenly get a yellow solid circle.
Click when you see that and you should have a complete area created.
Then, it's simply a matter of making sure the foreground color is black, which is 000000 and using the bucket filter.
Note that if you forgot to turn off the visibility of the original image, you may see it come through and you'll think you never did anything.
So, I did an example of that and there's an image on my website.
It's not bad, there's a couple of problems. On the right side in the top you can see thin strips.
I did not quite do my selection right.
Now, this can be fixed by going back to the layer mask and using the paintbrush tool to paint over these strips with the black color.
Also, I was not entirely satisfied with the way the horizon came out because I know the selection tools kind of a rough approach to it.
Now, another approach is going to allow us to learn some different tools, so it's worth doing just for that alone.
So, as before, I added the image, added an alpha channel, made a duplicate layer, but I did not add a layer mask to that layer.
That will come in a later step.
Then I selected the duplicate image, not the layer mask, the image itself, and went to the color menu, and I selected desaturate to turn it into a black and white image.
Then I went to the color menu again and selected something called the Curves tool.
Now, this tool has many uses for adjusting color balance, but in this case, I'm going to use it to increase the contrast of this black and white image.
Now, I've got a screen grab of the Curves tool, and you can see what I'm looking at.
Basically, what you're doing is you're grabbing handles.
When you first open it, you have a diagonal line going from the lower left to the upper right, and that is sort of everything equal kind of thing.
Then, when you click and drag away from that line in different places, you're going to change your color balance, and you can see what you're doing when you do that.
So, what I did was took the very bottom and pulled that to the right, and the very top, and pulled that to the left.
So, instead of a diagonal, I suddenly have something that is nearly vertical, but not quite, and that's pretty high contrast.
Now, with these settings, I got a photo that was part of the way where I wanted to be, but the sky was not entirely white.
So, what I did then was I got my paintbrush, swapped my foreground color to white, and painted out the rest of the sky, and then the bottom part, which I wanted to be all black, had white coming through.
So, I had to switch my foreground color back to black, and paint out the foreground a little bit.
And then, one more time, using the Curbs tool, I completed the separation, and got a really nice silhouette.
Now, this has all of the ground part that I want to keep is covered with black, and remember, black is transparent.
So, if I use this for my mask, I'm going to have the sky and lose everything else, I want to do the reverse.
So, what I do is I go again to the color menu, and select Invert.
Now, it's the sky that's black, and the ground that's white. So, we're almost there.
But so far, all I've done with this copy of the original image, I've created this silhouette, but how do I get this onto a layer mask?
And since I was doing all of this work on my first duplicate copy, I need another one to apply the layer mask to, and remember what we've talked about, you know,
Gimp Masters create layers all over the place. So, don't worry about it, that's how the thing is supposed to work.
So, I create another duplicate and add a layer mask to that duplicate layer, then just copy and paste.
Control C on the first duplicate image, which has the silhouette, then control V onto the layer mask.
Now, when you do this, it'll first show up as a floating layer on the clipboard, but if you go to the bottom, there's a button there called Anchor.
It looks like a boat anchor, and that will anchor it securely into the layer mask, and now when I go back, I can take a look at my image with this layer mask,
and see that I've got all of the grounds that I kept, but the sky is totally gone, and that's really what I wanted to achieve here.
I think it gives me the most detail, so I prefer it to the other end.
You can get something usable using a variety of techniques.
In order to keep this tutorial from not getting any longer, I did not get in the foreground select. I might do that for a different one.
But, now, you need to be careful that you've now got this layer mask in place.
Make sure that the only thing that you're looking at is this duplicate with the layer mask, and you've turned off visibility for everything else.
If you still have the original image visible, for instance, the sky will still be there because the original image will be showing through the transparency, so you can get very confused if you're not careful about which layers are visible.
Now, the final step, I want to do something. I took the sky out because I wanted to create something different.
So, I created a new layer and named it sky. To fill it, I decided to use a radial gradient.
Now, there are gradients that have radial in the name, but the fact is that most gradients can be applied as radials.
And what a radial gradient does is it changes colors from the center of the image out to the edges in a circular pattern.
So, to do this, start by selecting the gradient fill tool. If you know all your tools, you can get it from the tool window on the left, or what I do often is I just go to the tools menu.
Tools, paint tools, gradient. Or, if you happen to remember, the hotkey is G.
That means I'm in the gradient fill tool. Now, I've got to choose a gradient. So, I chose skyline as my gradient, and I did that in the gradient tab.
And then for the tool property, I went to the property shape, which is one of the properties. Remember properties when you select the tool properties appear under it on the left.
So, in the line that says shape, I selected radial. So, then I clicked on the center of my transparent sky layer and dragged out to the edge to fill the layer.
Now, when this was done, I moved the layer down below the image. So, it appeared through the transparency. And I got a final picture, and you can see that as well on my website.
And this has kind of a science section feel to it. It looks sort of like a moon orbiting a big planet in some alien system.
You know, I could go on from here and do something like insert some image of a spacecraft, but really this tutorial is long enough already, and it's done what I wanted it to do.
So, with that, this is a hookah for Hacker Public Radio.
Signing off, and as always, encouraging you to support free software. Bye-bye.
You've been listening to Hacker Public Radio at HackerPublicRadio.org. We are a community podcast network that releases shows every weekday, Monday through Friday.
Today's show, like all our shows, was contributed by an HPR listener like yourself. If you ever thought of recording a podcast, then click on our contributing to find out how easy it really is.
Hacker Public Radio was founded by the digital dog pound and the Infonomicon Computer Club, and is part of the binary revolution at binrev.com.
If you have comments on today's show, please email the host directly, leave a comment on the website or record a follow-up episode yourself.
Unless otherwise status, today's show is released on the creative comments, attribution, share a life, 3.0 license.