<div dir="ltr"><div>Hi Karsten,</div><div><br></div><div>First you have to ensure that the output data type is also Byte:</div><div>-ot Byte</div><div><br></div><div>Second, your original raster must be some kind of compression. You can see it with gdalinfo. So, you need to apply compression to the output file, for instance with: 

<p style="margin:0px;text-indent:0px;white-space:pre-wrap">-co COMPRESS=DEFLATE -co PREDICTOR=2 -co ZLEVEL=9</p><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><br></p><p style="margin:0px;text-indent:0px;white-space:pre-wrap">Best regards,</p><p style="margin:0px;text-indent:0px;white-space:pre-wrap">Pedro Venâncio</p><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><br></p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">karsten <<a href="mailto:karsten@terragis.net">karsten@terragis.net</a>> escreveu no dia sexta, 12/06/2020 à(s) 21:09:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>



<div>
<div><font size="2" face="Arial" color="#000080"><span>Hi 
All,</span></font></div>
<div> </div>
<div><font size="2" face="Arial" color="#000080"><span>I have 
a large *.tif raster data set ( 92000 * 69000 cells of one meter, projection 
EPSG:25832 - ETRS89 / UTM zone 32N )<br>It contains integer values 1 to 20 
and has a file size of  about 100 MB  in "Byte - Eight bit unsigned 
integer" format. <br>Now the result is a rectangle and I wanted to cut it 
down to the area of interest (via cutline gdal option) using a shape 
polygon file (with one continuous polygon inside) to and set all values outside 
the area of interest of that rectangle to NULL values (for example 
setting 0 as NULL data values). I used the QGIS ( QGIS v 3.12 on 
windows) Menu RASTER > Extraction > Clip Raster by mask Layer which 
is based on gdalwarp.<br></span></font></div>
<div><font size="2" face="Arial" color="#000080"><span>That 
is when I am running into the problem that the 'cut' file size increases 
enormously and I ended up wit 50 times bigger file ( 5 GB size ! ) when I 
was actually expecting a smaller file size than before.</span></font></div>
<div><font size="2" face="Arial" color="#000080"><span>I have 
not really an idea why the file becomes so enormously bloated. The 
same is the cass when I try gdalwarp directly on the command line or when using 
the QGIS Raster calculator or any other method I tried so 
far.</span></font></div>
<div><font size="2" face="Arial" color="#000080"><span></span></font> </div>
<div><font size="2" face="Arial" color="#000080"><span>How 
can I manage to get a smaller file size ( aka the 100 MB file size I started of 
with ) and which tools or formats are recommended  to achieve this 
?</span></font></div>
<div><font size="2" face="Arial" color="#000080"><span>Cheers</span></font></div>
<div><font size="2" face="Arial" color="#000080"><span>Karsten</span></font></div>
<div><font size="2" face="Arial" color="#000080"><span></span></font> </div>
<div><span style="font-size:11pt;font-family:"Verdana","sans-serif"">Karsten 
Vennemann<br></span><span style="font-size:9pt;font-family:"Verdana","sans-serif""><span style="color:rgb(0,50,100)"><a title="http://www.terragis.net/
blocked::http://www.terragis.net/" href="http://www.terragis.net" target="_blank"><font title="http://www.terragis.net/" color="#0000ff">www.terragis.net</font></a></span></span><u></u><u></u><u></u></div>
<div align="left">
<div align="left"><font size="2" face="Arial" color="#000080"></font> </div></div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div>