Dice grid from a photo with Python (II) – Drawing the dice
This post is part of the Project: Create a grid of dice from a photo with Python and PIL The logic behind the program Drawing the dice Create a grid of dice from a photo Design of the GUI Document and creation of the stand-alone executable Introduction In the previous post we analyzed all the steps to create a dicing grid from a picture in theory, but no code was written. In this post, I will show you how to draw dice with Pillow and its methods. In this post, we will see: How to install Pillow as a Python module How to import and use the methods in PIL.Image and PIL.ImageDraw in our code How to divide our code into functions Use of arguments and keyword arguments Installation of Pillow Pillow is a library that adds support for manipulation of images in Python. Pillow is a fork of PIL , appearing after the later stopped being updated in 2009. You can install Pillow through PIP on Windows, Mac, and Linux with the command: pip install Pillow Installing Pillow ...