Skip to main content
Question

Make a georeferenced PNG smaller


essb
Contributor
  • Contributor

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

redgeographics
Celebrity
Forum|alt.badge.img+49

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


essb
Contributor
  • Author
  • Contributor
  • July 8, 2022
redgeographics wrote:

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


redgeographics
Celebrity
Forum|alt.badge.img+49
essb wrote:

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.


essb
Contributor
  • Author
  • Contributor
  • July 8, 2022
essb wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings