3

When I use the Clipper tool on QGIS on a tiff file to reduce the tiff's area to the Area of Interest the file size is the same for both TIFF files (the smaller tiff and the original). Is there a way to reduce the file size and clip the area of an original tiff to a smaller area. Or is there also a way to reduce the size now that I clipped it besides reducing the resolution.

As shown, I have a large area in the first image shown, then after clipping into 4 different sections (where the redlines are) the Tiff files looks like in the second picture.

enter image description here

enter image description here

  • 1
    Welcome to GIS SE, please take the tour. If you add more information about your data and what you have done, it is easier to help. – DirkB. Jul 5 '17 at 19:53
  • @DirkBrunken Updated. – Shub Jul 5 '17 at 19:56
  • Ok, good! Now, how have you clipped your data? What are your inputs, did you set input and feature/ raster to clip right? Is your clipping tool looking like this? – DirkB. Jul 5 '17 at 20:03
  • @DirkBrunken I have already clipped the original Tiff down to four smaller size tiffs. Using the clipper tool my interface looked exactly like the picture shown. The size (in megabytes) is the same in the original and the clipped tiff. Unsure why. – Shub Jul 5 '17 at 20:07
4

You can compress it further by right-clicking the clipped tiff in the layer list and selecting Save As...

In that window, the format at the top should be kept to GTiff and set the CRS to whatever one you are using.

Go down to Create Options and change the Profile to High Compression.

showing how to compress tiff in qgis using the save as dialog


If you want to do this in one step, try using the Clipper tool for rasters found at Raster > Extraction > Clipper...

Set clipping mode to Mask layer and find your mask layer in the list.

Place a check beside Crop the extent of the target dataset to the extent of the cutline.

You will have to click the Pencil button to edit the gdalwarp command to include the compression options with -co "COMPRESS=DEFLATE" -co "PREDICTOR=2" -co "ZLEVEL=9"

clipping a raster with compression in one step with qgis


Another option, mentioned by @Steven Kay is use JPEG compression (which is lossy) but works well for images that are not used for analysis, like DEMs but only for visualizing (like your scanned map!).

You can follow the same steps as above, but instead use the following -co settings:

-co "COMPRESS=JPEG" -co "PHOTOMETRIC=YCBCR" -co "TILED=YES" -co "JPEG_QUALITY=75"

And optionally, consider adding overviews if you have a beefy raster that takes a long time to render when zoomed out and there are some excellent instructions at Paul Ramsey's blog http://blog.cleverelephant.ca/2015/02/geotiff-compression-for-dummies.html

  • as this is appears to be a scanned map rather than a DEM, JPEG compression is worth trying. Not sure how well it compares to DEFLATE but I find tiffs with JPEG compression can be a lot smaller than normal tiffs – Steven Kay Jul 5 '17 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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