Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

Image encoders: rustfmt

bflatastic9c8afb09ba0a
diff --git a/crates/render/src/encode/quantize.rs b/crates/render/src/encode/quantize.rs
index 5b3a08b29..ec04c9f46 100644
--- a/crates/render/src/encode/quantize.rs
+++ b/crates/render/src/encode/quantize.rs
@@ -198,7 +198,8 @@ pub fn quantize_locked(rgba: &[u8], width: u32, height: u32, o: &PaletteOptions,
let weights = o.reduction.weights();
let dither = if exact { Dither::None } else { o.dither };
// (A width past the pixels there are would size the error rows from a number nothing checked.)
- let mut indices = map(&colors, (width as usize).min(colors.len()), &palette, weights, dither, f32::from(o.dither_amount.min(100)) / 100.0, |i| clear(&px[i]));
+ let mut indices =
+ map(&colors, (width as usize).min(colors.len()), &palette, weights, dither, f32::from(o.dither_amount.min(100)) / 100.0, |i| clear(&px[i]));
// Drop the entries no pixel uses (fixed palettes), keeping the order.
let mut used = [false; 256];
for (i, &ix) in indices.iter().enumerate() {