This question already has an answer here:

I have a raster which I want to cut. A second raster smaller, should be exactly the part where I want to cut the first layer (so I cut the same size as raster 2).

The idea is that raster 2 become the mask for the cut. How can I do this?

marked as duplicate by underdark qgis May 25 '18 at 12:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You could convert "raster 2" to a polygon (Raster > Conversion > polygonize). Then run the Clipper tool (Raster > Extraction > Clipper...) and use the polygonized "raster 2" as the mask layer.

  • thank you alot it worked. If the clipper becomes 4 times bigger? the clipping times to extract the first raster is muuuuuch longer is that normal? – Magus Oct 6 '15 at 8:55
  • @Magus - Glad it worked! I think one of the main reasons which affect the length of processing time is the size of the rasters in the first place. So if the mask is larger, more processing needs to be done by the clipper :) – Joseph Oct 6 '15 at 9:55

You can use Vector -> Research Tools -> Polygon from Layer Extent on the smaller raster.

In a second step, use this polygon as a clip mask for the second raster with Raster -> Extraction -> Clipper.


Try using "raster calculator": Deduct raster 2 from raster 1 and then change zero values to null values.

Not the answer you're looking for? Browse other questions tagged or ask your own question.