Ensuring repeatable global histogram results #1413
-
I've noticed that output images are very subtly different after histogram equalisation is applied with the default global options. As a pretty basic test, the following code: for (var i = 0; i < 5; i++)
{
using var image = await Image.LoadAsync(@"c:\temp\input.jpg");
image.Mutate(c => c.HistogramEqualization());
await image.SaveAsync($@"c:\temp\output_{i}.png");
} produces files all with slightly different sizes:
I haven't looked into the code too much, but I'm assuming there's some sort of random sampling going on. Is there a way to ensure repeated applications of The background is that I'm applying a CLUT to an intensity range of a greyscale image, after histogram equalisation has been applied. The subtly different results between runs is resulting in noticeable differences in the CLUT-enhanced output and it would be good to avoid this if possible. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@nullpainter this is weird, I can't see any randomness in the processor implementations, the outputs should be deterministic. Can you double check this with an image diff tool, and if you can prove there is a pixel difference: |
Beta Was this translation helpful? Give feedback.
@nullpainter this is weird, I can't see any randomness in the processor implementations, the outputs should be deterministic.
Can you double check this with an image diff tool, and if you can prove there is a pixel difference:
open an issue with template filled + images attached (or even better a repro code doing a pixel comparison)?