Runs on Python 2.7. It seems that PIL does not yet support Python 3 series.
Python Imaging Library - Wikipedia
Image processing library. It seems that various image processing is implemented.
image.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Create an image file
"""
import Image
def make_image(screen, bgcolor, filename):
"""
Creating an image
"""
img = Image.new('RGB', screen,bgcolor)
#
#Add various processes here
#
img.save(filename)
return
if __name__ == '__main__':
#Image size
screen = (1024,768)
#Image background color (RGB)
bgcolor=(0xdd,0xdd,0xdd)
#File name to save (File format is automatically determined from the extension)
filename = "pil-01.png "
make_image(screen, bgcolor, filename)
#EOF
It is a script that just creates an image file (PNG format) without any twist.
Based on this script, we plan to add various image processing.
Recommended Posts