Python – PIL removes noise around points drawn by draw.ellipse

PIL removes noise around points drawn by draw.ellipse… here is a solution to the problem.

PIL removes noise around points drawn by draw.ellipse

I used draw.ellipse in PIL to draw some dots on the white image

 draw.ellipse((x[i][j] - 2, y[i][j] - 2, [i][j] + 2, [i][j] + 2), fill='black', outline='black')

((x,y) is the coordinate of the drawing).

Then I noticed some noise around blocks like this :

enter image description here

How can I get rid of them?

Add to.
The size of the original white plot is 315*207, and the plot size is 4*4

Solution

Do you save the image as a JPG file?

JPG compression creates noise around features, including your points.

Related Problems and Solutions