0

Add WebP image format support

Since Firefox 65 added support for WebP, users may be interested
in having maps that use WebP images. Support for this is added in
this commit, along with documentation for it.

A new option, "imglossless", controls whether we write out lossless
or lossy WebP images. The generic name "imglossless" as opposed to
a more specific "webplossless" was chosen in case future image
formats we also implement also support lossless/lossy modes in the
same format (JPEG-XL? AV1 image format?).

It's an okay meme but lossy mode really falls apart on our sorts
of images on the more zoomed out composite tiles, resulting in
pretty blurry messes. Might be due to a PSNR bias in the encoder,
which is to be expected from Google.
This commit is contained in:
Nicolas F
2019-03-04 17:04:09 +01:00
parent 7f63dfe315
commit 61ebd35240
5 changed files with 46 additions and 11 deletions

View File

@@ -71,6 +71,8 @@ renders = Setting(required=True, default=util.OrderedDict(),
"forcerender": Setting(required=False, validator=validateBool, default=None),
"imgformat": Setting(required=True, validator=validateImgFormat, default="png"),
"imgquality": Setting(required=False, validator=validateImgQuality, default=95),
"imglossless": Setting(required=False, validator=validateBool,
default=True),
"bgcolor": Setting(required=True, validator=validateBGColor, default="1a1a1a"),
"defaultzoom": Setting(required=True, validator=validateDefaultZoom, default=1),
"optimizeimg": Setting(required=True, validator=validateOptImg, default=[]),