Tetris-deep-Q-learning-pytorch icon indicating copy to clipboard operation
Tetris-deep-Q-learning-pytorch copied to clipboard

Blurry Tetris Pieces

Open Kontra21 opened this issue 5 years ago • 4 comments
trafficstars

Found that when running this on my machine the Tetris pieces were incredibly blurry.

image

Changing Line 242 in src/tetris.py from

img = img.resize((self.width * self.block_size, self.height * self.block_size))

to

img = img.resize((self.width * self.block_size, self.height * self.block_size),0)

solved the issue by forcing 0 antialiasing on resize.

Python 3.8 Mac OS 10.15.3

Kontra21 avatar Mar 30 '20 23:03 Kontra21

I faced the same issue on Python 3.8; Debian 10.3

titulebolide avatar Mar 31 '20 15:03 titulebolide

Because of what? Why is that? I spent a few days on it!!!

2197808908a avatar Sep 13 '22 14:09 2197808908a

Because you need to force antialiasing to 0 as per my code example above

Kontra21 avatar Sep 16 '22 07:09 Kontra21

Because the default filter of image resize function is' PIL.Image.BICUBIC ', the image produced by resize is blurred, so force filter 4 to be changed to 'PIL.Image.BOX' Changing Line 242 in src/tetris.py from

img = img.resize((self.width * self.block_size, self.height * self.block_size))

to

img = img.resize((self.width * self.block_size, self.height * self.block_size),Image.BOX)

kwin1412 avatar Jan 13 '23 16:01 kwin1412