We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent6aad8f2 commite3007a7Copy full SHA for e3007a7
src/hist.rs
@@ -320,7 +320,7 @@ impl Histogram {
320
321
// Limit perceptual weight to 1/10th of the image surface area to prevent
322
// a single color from dominating all others.
323
-let max_perceptual_weight =0.1*(temp.iter().map(|t| f64::from(t.weight)).sum::<f64>() /256.)asf32;
+let max_perceptual_weight =((0.1/255.)*temp.iter().map(|t| f64::from(t.weight)).sum::<f64>())asf32;
324
325
let lut =gamma_lut(gamma);
326
letmut total_perceptual_weight =0.;
@@ -331,9 +331,9 @@ impl Histogram {
331
332
// weight == 0 means it's a fixed color
333
let weight =if temp_item.weight >0.{
334
-(temp_item.weight*(1. /256.)).min(max_perceptual_weight)
+(temp_item.weight*(1. /255.)).min(max_perceptual_weight)
335
}else{
336
- max_perceptual_weight*10.
+ max_perceptual_weight*16.
337
};
338
total_perceptual_weight += f64::from(weight);
339