Reputation: 181
for i in range(25, 665):
for j in range(55, 690):
pixel = background[i,j]
whitePixel = [255,255,255]
if np.array_equal(pixel,whitePixel):
background[i,j] = rightsize[i-25,j-55]
when I do this code I get an image with ugly edges like this-
does anyone know how I can fix this and get it right? I dont understand Why it is doing this I have even tried adjusting the area of the rectangle so it was a little bigger than the white area and it still did this-
original background image-
now, the other image (rightsize) is just an image of the coin, which I cropped out in a perfect square around the coin, and resized to try and fit perfectly in a same sized square around that white circle, and replace the white parts with the coin, but for some reason the edges turn out like that. I have had this same problem before when doing a double loop like this to replace pixels.
Upvotes: 0
Views: 427