Article index:
- 1 – Pillow Installation
- 2 – Pillow Version
- 3 – Image Loading and Saving
- 4 – Reading the pixels
- 5 – Image Processing
- 6 – Image Processing Operations
- 7 – Adding a watermark
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:
Article index: