-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support writing PNGs with filter 3 #3
Comments
@kkaefer It appears that GDAL http://www.gdal.org/frmt_various.html#PNG nor Pillow http://pillow.readthedocs.io/en/3.1.x/handbook/image-file-formats.html#png support that option; I added a |
I think it's because we use |
Yeah, which we have to, as any lossy compression or even resampling will corrupt the encoding. |
I wanted to chime in here from a users perspective higher up the Mapbox stack. The first thing I noticed back when I tested out GL JS's hillshading was using raster-dem/terrain-rgb tiles were much slower to load than the original vector hillshading layers from the mapbox terrain tileset. On a sample page the terrain-rgb tiles took up 3.2M of 4.1M in total, with the normal vector tiles poping in at about 1.5s, labels at about 2s, but then it takes until 6s for the terrain tiles to finish downloading. We should be able to do better than that. So I took a look and found asking for terrain-rgb webp tiles only serves pngs.
I tried a few compression options to see what affect that would have:
That matches exactly the findings of @kkaefer and @dnomadb given pngcrush I believe is finding the optimal png filter, both of them doing everything lossless. Given webp isn't well supported that 30% gain on PNGs by changing the filter would be a huge win for users, together with the availability of webp terrain-rgb tiles for a 50% gain. |
Bit off topic but I was happy to read this has been done now in the new Mapbox Raster Data API announced at https://www.mapbox.com/blog/mapbox-gl-js-v2-3d-maps-camera-api-sky-api-launch |
Using filter 3 results in ~30% smaller PNG files in some situations.
The text was updated successfully, but these errors were encountered: