Use static kmeans seed

This commit is contained in:
2025-07-31 07:37:47 -05:00
parent 6ee36cb65a
commit d0f0d07b51
2 changed files with 3 additions and 0 deletions

View File

@ -36,5 +36,6 @@ TODO
+ ~~add cache for album art colors~~
+ ~~add spotify link fetching~~
+ ~~add arbitrary spotify searching~~
+ ~~use static seed for kmeans~~
+ make various parameters user-configurable
+ use tiny-skia instead of magick-rust?

View File

@ -14,6 +14,7 @@ extern crate magick_rust;
use magick_rust::{
ColorspaceType, CompositeOperator, FilterType, MagickWand, PixelWand, magick_wand_genesis,
};
use magick_rust::bindings::MagickSetSeed;
use std::env;
use std::collections::HashMap;
@ -266,6 +267,7 @@ async fn fmi(ctx: &Context, arg: Option<&str>, id: UserId, avatar: Option<String
art_wand_cluster.set_image_colorspace(ColorspaceType::Lab),
"Failed to set cluster colorspace"
);
unsafe { MagickSetSeed(0x5F3759DF); }
handle_magick_result!(
art_wand_cluster.kmeans(10, 200, 0.001),
"Failed to run kmeans"