Opened 6 years ago

Last modified 3 years ago

#86 new defect

Airbrush in multicolor is not random enough

Reported by: yrizoud@… Owned by: pulkomandy
Priority: minor Milestone: 2.9
Component: GrafX2 Version: 2.6
Keywords: Cc:


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 yrizoud@…, 6 years ago

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.

comment:2 by PulkoMandy, 5 years ago

Milestone: 2.6

comment:3 by PulkoMandy, 5 years ago

Milestone: 2.62.7

Move open tickets to 2.7 milestone

comment:4 by PulkoMandy, 4 years ago

Milestone: 2.72.8

comment:5 by PulkoMandy, 3 years ago

Milestone: 2.82.9
Note: See TracTickets for help on using tickets.