How to Clip a Raster Layer with QGIS
Aug 18, 2025
It's easy to clip a satellite image or other raster layer with QGIS. Satellite images are little more difficult and take more than one step. First, you'll need to create a virtual raster that contains all the bands. Next, define the extent of the clipped image. Then you're done. This video will demonstrate the tools and steps to clip a raster layer or satellite image in QGIS. How to download Landsat images: https://youtu.be/5xfZApBBc6Y Check out my website for more: https://opensourceoptions.com
View Video Transcript
0:01
Welcome to Open Source Options. Let me
0:03
show you today how you can take a
0:05
satellite image and clip it down to a
0:08
smaller area. Uh to get started, we're
0:11
going to pull in some LANCAT satellite
0:13
imagery. Uh I have a previous video on
0:16
how to download and obtain this imagery
0:19
if you're interested in that or don't
0:20
know how to do it. But I'm just going to
0:22
skip ahead because that's already
0:23
documented. So let's go ahead. I have
0:25
this LANCAT image here. I'm going to
0:27
grab these seven bands.
0:29
and pull them in.
0:32
Okay, so we see we have these seven
0:34
bands here. They're now showing up in my
0:36
layers. We can just minimize these to
0:38
get a better view of what we have.
0:41
I'm not going to worry about describing
0:43
these seven bands right now. Um, I'm
0:45
just going to show you how you can clip
0:46
this image. Now, the important thing
0:48
here is if you want to clip an image,
0:50
you usually want to clip more than one
0:52
band. If we just clip a single band, we
0:54
have to go through and do this
0:55
individually. uh the we'll have to do
0:57
the clip individually for each band, but
0:59
there's a much easier way to do this. I
1:02
think the first thing you want to do is
1:03
to get all your data together in a
1:05
virtual raster and then clip that
1:07
virtual raster one time. And that's
1:09
exactly what I'm going to demonstrate to
1:11
you here. So, let's go ahead and create
1:13
that virtual raster. We can come up to
1:15
the menu, go to raster,
1:18
uh go to miscellaneous, build virtual
1:21
raster. That will pop up this dialogue
1:24
here. Now, we're going to go and we're
1:26
going to select our inputs. I want to
1:28
select all these bands. I want to make
1:30
sure they're in the correct order. 1 2 3
1:33
4 5 6 7. Select all. Okay. Now, I want
1:38
to place each input file into a separate
1:41
band. For the resolution, we can select
1:43
average. These should all be the same
1:44
resolution.
1:46
And now, we're going to leave the
1:49
defaults.
1:50
I'm going to save this. Uh,
1:55
sure. We'll save to a file so we can
1:58
have this for later. And if I go to my
2:00
downloads
2:01
and I want to find LANCAT L2 and this is
2:07
the image
2:09
uh 0930. So, it's this one here. I'm
2:12
just going to save it in this folder.
2:14
and we will name it
2:18
uh
2:19
let's go LC9.
2:23
We'll just grab
2:25
this here, but we'll change the end of
2:28
this.
2:30
So, we'll call this VRT at the end.
2:35
And now we'll save that. So, we'll have
2:38
the same file name as everything else.
2:40
That way, we'll know which image it
2:42
belongs to. So, we can click save. And
2:44
now we can click run. And this should
2:47
run really quickly. And as you can see,
2:48
it did. So, let's close that. Let's
2:50
slide this guy up to the top. Let's turn
2:53
off all of these.
2:56
You can see we have a very interesting
2:58
color combination here. We can update
3:00
this um red. This should go four, three,
3:06
two. And now we have a true color image.
3:10
Now, let's go in and find the area of
3:12
this image we're interested in. Let's
3:14
say we want to focus on this reservoir
3:17
of these agricultural fields. We're not
3:19
interested in anything else. And so, we
3:21
want to clip this image down so it's
3:23
easier to work with. Now, the way we can
3:26
do that, there's a few ways. Um, but
3:29
let's go do the easiest one first. So,
3:30
we can go to raster
3:33
extraction,
3:34
and we want to clip raster by extend.
3:39
And so here we're going to clip this to
3:42
uh a square or to a rectangular area.
3:46
And there are a few ways to set up this
3:49
clipping extent. And we can find them by
3:51
clicking on the drop down here. We can
3:53
calculate from a layer. So this will
3:55
give us the extent of a layer. So this
3:57
be a rectangular uh shape calculated
4:00
from a layer. We can calculate from a
4:02
layout map. So, if we have a layout map
4:06
uh in our
4:09
um in our layouts, we can use that. We
4:12
can calculate from a bookmark. I
4:13
currently don't have any. I'll show you
4:15
that real quick. Let's make a bookmark.
4:17
Let's close this down. And let's just
4:20
zoom in here to the area we like. And
4:23
let's say it's the area that is filling
4:26
the screen right now. And so what we can
4:29
do is we can come into our browser and
4:33
we can go over here to our spatial
4:35
bookmarks. Uh we can uh make a new
4:40
spatial bookmark. And you can see it's
4:43
doing this right here. And we can call
4:45
this our extent. And we can click save.
4:50
Now if we go in back to raster
4:54
extraction
4:56
clip raster by extent our clipping
4:59
extent we can calcate from a bookmark
5:01
and we have our extent here. When we
5:03
click that you'll notice that it updates
5:06
our clipping extent with those
5:07
coordinates.
5:09
Pretty easy. The next thing we can do
5:11
and that's if you want to use the same
5:12
extent over and over again that's going
5:14
to be the easiest way to do it. The next
5:16
thing we can do is we if we just want to
5:18
draw we can do
5:21
well we can click use current map canvas
5:23
extent or we can click on draw on map
5:27
canvas. And if we want to make this a
5:29
little more custom we can come down and
5:30
just draw this rectangle
5:32
like that.
5:34
And now we have that extent there. Let's
5:38
go ahead and run with that extent. And
5:41
so the next thing we'll need to do is
5:42
just come in.
5:46
And
5:48
I'm going to save this to a temporary
5:49
file.
5:51
And we'll just click run.
5:55
So that says it's finished. So we can
5:57
close this. Let's go take a look.
6:00
There's our clipped. Let's turn that
6:01
off. And now you can see we have this
6:04
clipped image. And if we change our
6:06
colors to four, three, two, so it's true
6:11
color. You can see now we're just
6:13
looking at this little area. And that
6:16
was super easy to do. And now we can
6:18
turn this image back on. And there you
6:21
can see that we have the other image.
6:25
Now you're noticing some color
6:26
differences here.
6:29
And the reason for that is you notice
6:32
how our contrast enhancement is
6:35
stretched min to max. Well, now that
6:37
we've clipped these bands to a smaller
6:39
area, they have different min and max
6:41
values. So that contrast changes because
6:44
we're stretching it across different
6:46
minimums and maximums. So that's why
6:48
you're going to see some differences
6:49
there. All right, so this is a pretty
6:52
short tutorial. That's how you can clip
6:54
a raster or clip a satellite image to an
6:58
extent in QGIS. Now, I have free courses
7:02
coming. I know I've been saying that for
7:04
a lot of videos. I've started on the
7:05
first free course, which is going to be
7:07
GIS foundation or GIS fundamentals. I'm
7:09
not sure on the title yet, but it's
7:11
going to be available on open source
7:12
options.com. So go ahead uh and you can
7:16
sign up to receive notifications at
7:18
opensource options.com uh and then
7:21
you'll get notified when that course
7:22
comes out or you can just keep an eye
7:23
out. It is coming soon. Um if you have
7:26
questions, if there's something I didn't
7:28
cover here that you want to see, please
7:30
leave a comment below. Let me know. Um I
7:32
have another video video coming that
7:34
will show you how to do this with a
7:35
shape file. So how to clip it to an
7:37
irregular area that's not rectangular.
7:40
Again, thanks for watching. Enjoy your
7:42
day and I'll see you back here soon.