Reputation: 9
as you can see in the code, I have a completely white image. Then I assign the color green to certain pixels, while iterating over the image. However, in the result image, there are pixels with shades of green and not just one green color. This is the code:
height, width = drawImage1.shape
# creating a blank white image
drawImage2 = np.zeros((height,width,3), np.uint8)
drawImage2[:] = (255,255,255)
for x in range(height):
for y in range(width):
if(drawImage1[x,y] == 0):
drawImage2[x,y] = [0,255,0]
cv2.imwrite('alignmentResult.jpg', drawImage2)
enter image description here Here you see a zoomed-in screenshot from windows photo viewer. I get the same result, with other photo programs.
Does anyone have an idea, how this is possible, since there is only one color specified. Maybe this is added just to make the image preview more smooth for the human eye.
Thanks alot!
I have tried to use a binarized image (that is obviously fully black and white) and then converted in back to color. But I got the same result.
Upvotes: 0
Views: 113