Skip Navigation

When you think 'RBG' instead of 'RGB' while doing a Hexcodle puzzle

Her name is very memorable. Unless I'm careful, I will mix up the acronyms.

Assuming I did this correctly, here is the image source and the code I used:

from PIL import Image

img = Image.open('image.bmp')
img = img.convert('RGB')
new_img = Image.new('RGB', img.size)

for x in range(img.width):
    for y in range(img.height):
        r, g, b = img.getpixel((x, y))
        new_img.putpixel((x, y), (r, b, g))

new_img.save('flipped_image.png')
3
3 comments