# Examples¶

This page contains some examples on how to use pi2 for simple (and some not so simple) tasks. All the examples are given in Python 3.6. They can be found in a single Python file here.

The examples require a few small images that can be downloaded from here.

In order to run the examples, please run this initialization first (make sure that the file paths point to correct locations):

import numpy as np
from pi2py2 import *
pi = Pi2()

# Define convenience functions that return input and output file names.
# This is just to avoid copying the paths to all the examples in case they change.