Pillow is one of the most important packages for python. Exist in many projects as dependencies. Very important is how you install this package in the environment to protect yourself from many frustrations. Let's start by installing Xcode command-line tools:

xcode-select --install

Next step is to install dependencies for pillow using homebrew:

brew install libtiff libjpeg webp little-cms2

Next install libraqm and its dependencies:

brew install freetype harfbuzz fribidi

Last step install pillow:

python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow

Not easy to install but it's a very powerful package that can be used to manipulate images.