png compression

redbeardredbeard Global Mapper UserPosts: 279Trusted User
edited August 2010 in Suggestion Box
I'm not sure how compressed the png's that GM puts out, but when you export to google maps format the many many files can take up many many bits. Is it possible to implement a post process compression like http://pmt.sourceforge.net/pngcrush/ or something similar? I know there are some others out there, and You might be able to find one with a free non restrictive license (like freebsd licence or something). Just a suggestion at the moment. I think others have reported 50% reduction in file size when they used it on the output of a different program.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited July 2010
    The PNG format is a lossless compression format so it's not like JPEG where you can make a compromise between quality and compression. It does sound like maybe the PNG library doesn't automatically try and bunch of different lossless compression methods but maybe just guesses at the best one. I would have expected it to try different ones to find the best choice, but maybe it just takes too much longer, especially given how cheap data storage is nowadays. Have you run pngcrush on the outputs from Global Mapper to see if it makes any appreciable difference?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited July 2010
    I haven't - I can only run it on one file at a time, so it's a little tedious for a non-scripter/programmer type.

    Perhaps I'll just export a usgs quad in png and see what difference the pngcrush thing does. It will be friday before I can try.
  • MattMatt Global Mapper User Posts: 176Trusted User
    edited July 2010
    Irfanview (free) will batch compress PNGs. I think you need the plugin pack for that function. I think the bigger issue is speed. It can take several seconds to compress each PNG.

    I've also had good luck with lossy GIF compression, especially raster maps. That's been the only way I've been able to figure out how to have lossy compression and alpha channel. But Photoshop is the only program I've found that will do lossy GIF compression.

    Matt
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited August 2010
    Several seconds is a long time when you deal with 7+ digit numbers of tiles. Just after reading about 50% compression in disk space (and thus bandwidth), compression seems nice. Does Irfanview crawl through directories and compress them? If so I could just set it to run for a while and still use the data...
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited August 2010
    So I gave it a test run - it took way less than several seconds, and that's at the best compression level. The other thing, based on 20k tiles or so, it didnt really save that much - I think the files were just over 10% smaller, so the compression that global mapper is pretty good.

    Odd thing that I noticed about irfanview - if the file globalmapper had was 1kb - the irfanview file was 2kb - the others were less than what globalmapper had.

    -so that's my current findings.
  • MattMatt Global Mapper User Posts: 176Trusted User
    edited August 2010
    Ya, I suppose the time per tile depends on the size. You might also try the PNG Out plugin for Irfanview. I think that gets a little bit better compression.
Sign In or Register to comment.