(img)
| 6 | |
| 7 | |
| 8 | def convert_to_negative(img): |
| 9 | # getting number of pixels in the image |
| 10 | pixel_h, pixel_v = img.shape[0], img.shape[1] |
| 11 | |
| 12 | # converting each pixel's color to its negative |
| 13 | for i in range(pixel_h): |
| 14 | for j in range(pixel_v): |
| 15 | img[i][j] = [255, 255, 255] - img[i][j] |
| 16 | |
| 17 | return img |
| 18 | |
| 19 | |
| 20 | if __name__ == "__main__": |
no outgoing calls
no test coverage detected