Class 22 — October 13
Trying out a new pillow
Pillow is software — Go try and figure it out — For a thousand words
Look both ways
Agenda
- Introduce Pillow for image generation and manipulation
Redownloads
- Module url.py
- Program pillow_painting.py
- Program canvases.py
- Program paint.py
Downloads
- Program gradient.py
- Program groovy.py
- Program wahoo.py
Discussion
- Pillow is a library for manipulating images in Python. Unlike the math library and others we have used, Pillow is not part of the standard Python install; you have to add it yourself.
- To install Pillow on your laptop go here.
- For now the parts of Pillow of interest to us are:
- Image: Pillow representation of an image.
- ImageDraw: Pillow image drawing commands.
- The Image has one particular function of current interest to us:
Image.new( m, size, color='black' )
returns a mode m new image, whose dimensions are size. The background of the image color. Parameter color is optional with a default value of black. For us,
m
will always be the string'RGB'
;
size
will always be an ordered pair of the form( w, h )
, wherew
is the width of the image andh
is the height of the image.
To do
- Look over artifacts
- Review paint.py
- Review Pillow drawing module
- Checkout last semester artistry
- Checkout past artistry highlights