RogerioBlanco / PixelCanvasBot

A bot to pixelcanvas.io
63 stars 24 forks source link

Quick fill Strategies does not consistent in multiple image parts. #87

Open Qh0stM4N opened 5 years ago

Qh0stM4N commented 5 years ago

ref PR: #74 QuickFill strategyes not sensitive coordinates.

For example I can copmlate image split 4 part. But not centered.

example complate scenario, images is 100 px X 100 px, start coordinates 0,0 image drawing 3 cilent. Client 1 start at 0,0 cordinates. 20 100 image part. Client 2 started 0,51 coordinates part 35 100 image part. Client 3 started 0,0 coordinates part full image.

Expected result cillent 1 and 3 schnorized but cillent 2 and 3 draw full image. @HxxxxxS pls test for me this schenario

HxxxxxS commented 5 years ago

Im sorry but I don't think I understand you. Do you mean each client should be able to specify which part of the image to draw?

HxxxxxS commented 5 years ago

For example I can copmlate image split 4 part. But not centered.

Do you mean you want to use the --xreversed parameters from #80 to start centeed?

Qh0stM4N commented 5 years ago

@HxxxxxS maybe can show:

  1. full image, 2. part1 3. part2 4. part1 output 5. part2 output 6. result image problem occurs in the picture starting from position 0,0 when the multiples of 2 aren't used. this figure part 1 start position 0,0 part 2 7,0 intersection zone filled earlier than expected.
HxxxxxS commented 5 years ago

I see. I guess we can add another parameter for the quickfill strategy to choose between starting with even/odd pixels?

You could also make sure all the partial images have even or odd amount of X-axis pixels.

Qh0stM4N commented 5 years ago

@HxxxxxS Maybe, but dont nedded new even/odd parameter we can calculate like this pseudo code even/odd = (startX + startY) % 2; or even/odd = ((startX + startY) % 2) isEqual 1 ? param_even/odd : !param_even/odd;

HxxxxxS commented 5 years ago

Changing the self.b variable at https://github.com/RogerioBlanco/PixelCanvasBot/blob/master/src/strategy.py#L80 should let you change wether to start drawing on odd/even.