CartoDB / basemap-styles

CARTO basemap public styles
Other
222 stars 32 forks source link

Support for WebP and/or Avif? #40

Closed peteruithoven closed 1 month ago

peteruithoven commented 1 month ago

I'm not sure if this is the right place to ask, but is there a way to use the webp or avif instead of png image format? The documentation only mentions .png. https://github.com/CartoDB/basemap-styles?tab=readme-ov-file#1-web-raster-basemaps

Browser support for these is great:

More info on the formats: https://www.smashingmagazine.com/2021/09/modern-image-formats-avif-webp/

Possibly relevant: https://github.com/openstreetmap/operations/issues/902

peteruithoven commented 1 month ago

Style is written in CartoCSS using Mapbox Studio Classic (https://www.mapbox.com/mapbox-studio-classic/), and shared here as Mapbox Studio Classic project

Reading that the limitation might be on the Mapbox side? https://docs.mapbox.com/help/dive-deeper/static-maps/#creating-static-maps

peteruithoven commented 1 month ago

Mapbox seems to switch to webp when supported by browser: https://github.com/mapbox/mapbox-gl-js/pull/1756 https://github.com/mapbox/mapbox-gl-js/blob/main/src/util/mapbox.ts#L139

(I'm using Leaflet)

padawannn commented 1 month ago

Sorry but for the moment, Carto basemaps raster are only available in PNG formats