HOME/Articles/

pil example contour (snippet)

Article Outline

Python pil example 'contour'

python contour

Python pil example: contour

# -*- coding: utf-8 -*-
from PIL import Image
from PIL import ImageFilter


# Get an image
image = Image.open('images/image.jpg')

# Get the contour
image = image.filter(ImageFilter.CONTOUR)

# Save image
image.save('images/image_contour.jpg')

# Show image
image.show()