CartoDB / basemap-styles

CARTO basemap public styles
Other
230 stars 33 forks source link

Support for WebP and/or Avif? #40

Closed peteruithoven closed 4 months ago

peteruithoven commented 4 months 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 4 months 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 4 months 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 4 months ago

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