Beginning with Pillow, the PIL Fork (Python Imaging Library)

Article index:

3 – Image Loading and Saving

Just use the open() function of the Image module. To save the file, use the save() function of the image object.

im = Image.open("glslhacker.jpg")
imageW = im.size[0]
imageH = im.size[1]
im.save("glslhacker.png")

# Show the image in the default image viewer
im.show()

The full demo is available in moon3d/gl-210-python-pil-pillow/pillow_image_loading.xml. Just load it in GLSL Hacker and you should have:

GLSL Hacker, Pillow (PIL fork) image loading, Python





Article index: