Last thing first, you still use import PIL
like normal, Pillow
is just a fork of the original PIL
library that is no longer maintained (for years). So you don’t change any code, only the name of the library thats installed by pip
changes to pip install Pillow
instead of PIL.
From looking at the code in the clone of their app this is how @eli originally used PIL in the example link you posted above.