Question

Make a georeferenced PNG smaller


I created a georeferenced png over a large are 20x20km (ortophoto and vector-layers) using MapnikRasterizer, needless to say the png is extremly big over 170 MB using option rgb24 in mapnik.

 

Is there a way to make the file smaller without using png optimization in the png writer?

 

I tried clipping the raster where the vector lines overlay it to just focus on the area of interest. But the png is still big. Seems like the cells with no data still takes up alot of storage.

 

 


4 replies

Userlevel 5
Badge +25

Does it have to be PNG? The JPG algorithm tends to offer better results for orthophotos and other imagery.

Does it have to be PNG? The JPG algorithm tends to offer better results for orthophotos and other imagery.

I will try and see how much difference there is.

 

But I was thinking if there was a way to like nullify the empty raster cells so they dont take up any space. Cause When I clip the data I get around 70% empty space that now are white color and those still take up as much space as if it would be like a real ortophoto

Userlevel 5
Badge +25

I will try and see how much difference there is.

 

But I was thinking if there was a way to like nullify the empty raster cells so they dont take up any space. Cause When I clip the data I get around 70% empty space that now are white color and those still take up as much space as if it would be like a real ortophoto

If you use RGB it will indeed fill them with white (or another nodata color), you could try RGBA so you'll get transparency. That way an empty cell only takes 8 bits, rather than 3 x 8. In that case you do have to write to PNG of course.

I will try and see how much difference there is.

 

But I was thinking if there was a way to like nullify the empty raster cells so they dont take up any space. Cause When I clip the data I get around 70% empty space that now are white color and those still take up as much space as if it would be like a real ortophoto

Thanks, my question is answered. The JPG does indeed give very small files compared to PNG.

Reply