CSC 240: Computer Graphics
Lab 1: Checkerboard
- Download lab1.py and
raster.py.
- Open up the terminal, run:
python --version
It should be 3.4.3.
- Navigate to where you saved lab1.py and run:
python lab1.py
What commandline arguments does it require?
- To create a 400x100 pixel image, run:
python lab1.py 400 100
What do you get?
- In the function make_image, only one pixel is colored. Replace
these lines with code that loops over every pixel in the image and
colors it using pix_color.
- Replace pix_color with a function that colors the pixel "blue" if
x is even and "white" if x is odd.
- Modify pix_color to make a checkerboard.
BONUS: Make your checkerboard more interesting! Different colors,
different block sizes, etc.