mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 11:51:33 +00:00
A layer whose image is "flat colours" is matched against the loaded filaments alone, no mixes. The verdict came from one signal: the share of the image covered by the eight fullest bins of a coarse histogram, flat above 0.85. A ramp between two colours is a straight line through colour space, so it occupies as few bins as the two colours on their own and scores just as high. The shipped "Colour Bricks.png" measures 0.96 and gets no mixes at all; a green-to-red gradient measures 0.90 and prints as two flat areas. Judged on a second signal as well: the share of the image's principal colour axis that carries pixels, in 32 steps. A ramp fills it end to end, a handful of flat colours sits in spikes with gaps between them. An image counts as flat only when both agree, so this can only restore mixes where they were refused, never take them away. Measured coverage: 1.00 for a gradient, 0.06 for a two-colour logo, 0.41 to 0.62 for photographs, against a threshold of 0.25. Colour Bricks.png goes from 0 mixes to 6, a green-to-red gradient from 0 to 11.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: