Opened 2 years ago

Last modified 6 months ago

#86 new defect

Airbrush in multicolor is not random enough

Reported by: yrizoud@… Owned by: pulkomandy
Priority: minor Milestone: 2.8
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 (4)

comment:1 Changed 2 years ago by yrizoud@…

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 Changed 20 months ago by PulkoMandy

Milestone: 2.6

comment:3 Changed 18 months ago by PulkoMandy

Milestone: 2.62.7

Move open tickets to 2.7 milestone

comment:4 Changed 6 months ago by PulkoMandy

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