Reload a PNG

save then Image.open.

save then Image.open is the round trip. The PNG becomes a chip.

Goal

Write out.png, reopen, print size.

from PIL import Image
im = Image.new('RGB', (40, 24), (29, 79, 122))
im.save('out.png')
loaded = Image.open('out.png')
print(loaded.size, loaded.mode)
from PIL import Image
print(Image.open('out.png').getpixel((0, 0)))
from pathlib import Path
print('out.png', Path('out.png').stat().st_size)
from PIL import Image
Image.new('RGB', (8, 8), (0, 128, 64)).save('chip.png')
print('wrote chip.png')