Opened 5 years ago
Last modified 3 years ago
#86 new defect
Airbrush in multicolor is not random enough
Reported by: | Owned by: | pulkomandy | |
---|---|---|---|
Priority: | minor | Milestone: | 2.9 |
Component: | GrafX2 | Version: | 2.6 |
Keywords: | Cc: |
Description
Set Airbrush to multi-color mode, and tag 3 contiguous colors range in the palette. Now use the airbrush, and you'll see that nearly all painted colors will use the first and last color, almost nothing in-between.
This is because the algorithm selects a direction (backward or forward), a random starting color, and them moves until it finds a color which is tagged. This favors considerably the colors that have the most untagged colors on either side. A more fair distribution would be to prepare an array of tagged colors behorehand, and pick in it. There's no need to weigh by color-specific amount, because this amount is already used to paint several times : If you tag red-1 and blue-10, you want 50% chance of painting 1 red pixel, and 50% of painting 10 blue pixels.
(I think this is an original bug from the MS-DOS version)
Change History (5)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Milestone: | → 2.6 |
---|
comment:4 by , 4 years ago
Milestone: | 2.7 → 2.8 |
---|
comment:5 by , 3 years ago
Milestone: | 2.8 → 2.9 |
---|
Argh, this is more complicated than that : The issue is more specifically if size=1 (or large brushes and small airbrush size), because "the last painted pixel wins". It's not that the distribution is wrong, but rather that it is called almost always in the same order. Shuffling the tagged colors is necessary.