core, viewer: add support for WebP output

WebP can be selected by passing `--image-format webp` on the command
line. For typical Minecraft worlds, this results in a size reduction of
10-15% without increasing processing time.
This commit is contained in:
Matthias Schiffer 2025-01-11 01:24:58 +01:00
parent bb11b29e92
commit c23b53a8c3
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
11 changed files with 81 additions and 11 deletions

View file

@ -61,6 +61,8 @@ struct Metadata<'t> {
spawn: Spawn,
/// Enabled MinedMap features
features: Features,
/// Format of generated map tiles
tile_extension: &'static str,
}
/// Viewer entity JSON data structure
@ -205,6 +207,7 @@ impl<'a> MetadataWriter<'a> {
mipmaps: Vec::new(),
spawn: Self::spawn(&level_dat),
features,
tile_extension: self.config.tile_extension(),
};
for tile_map in self.tiles.iter() {