Skip to main content
1 of 2

File size inflation using GDAL

New to GDAL, have some tiff files and I'm trying to do the following:

"0 to NoData" to avoid black background in Mapbox:

gdalwarp -dstnodata 0 -dstalpha [input file] [output file]

The problem is, the output file size for this tasks is huge (≈150MB to ≈10GB).

The same thing occurs when I next add a color relief:

gdaldem color-relief -of GTiff [input file] [color text file] [output file]  -alpha

The file size roughly doubles...

My only guess is that the data is remaining as a value and is somehow being interpreted as such, so my only option is to compress the file using LZW afterwards. However, this process takes a ridiculously long time to complete, so I'd like to find a more efficient way. I typically don't see such great file inflation, but this dataset is new to me.