Code Challenge 31 - Image Manipulation With Pillow

Posted by PyBites on Tue 08 August 2017 in Challenges • 2 min read

Life is about facing new challenges - Kostya Tszyu

Hi Pythonistas, a new week, a new 'bite' of Python coding. Let's shift gears a little bit: this week we have you choose an image manipulation task using Pillow, "the friendly PIL (Python Imaging Library) fork". Have fun!

The challenge

Create a new virtual env, pip install Pillow and use the module for one of the following tasks:

  • Create a tool to create thumbnails of a set of images.

  • Use Instagram like filters on a bunch of images.

  • Make promo banners for your brand or cause using Pillow: basically put your logo, a nice background and text on a canvas and save to file. Example made with Gimp, what about generating something similar with Pillow?

  • Similar as last one: make a birthday ecard generator.

  • Add a watermark to an image.

  • Feel free to do something else if that inspires you more, as long as you use Pillow!

Bonus

  • Wrap the utility up in a little Flask app with interactive input/select boxes, for example:

    • Featured Image Creator was a PHP/JS/CSS project I (Bob) did some time ago. Maybe you can build something similar using Flask (JS) for user interaction and Pillow to generate the image upon form submit?

    • For a thumbnail generator you could have a (multi) image upload button which batch resizes them and shows them in the browser or generates a zipfile for download.

    • What about the (birthday) ecard generator: let the user choose between a set of images, enter a text and show the generated card in the browser with download link.

    • Etc ... combining user interaction (web app) and Pillow you can build some cool stuff. The possibilities are endless, surprise us ...

  • Deploy your solution to Heroku to show it to the world (and mention the URL in your PR).

Resources

Getting ready

See our INSTALL doc how to fork our challenges repo to get cracking.

This doc also provides you with instructions how you can submit your code to our community branch via a Pull Request (PR). We will feature your PRs in our end-of-the-week challenge review (previous editions).

Feedback

If you have ideas for a future challenge or find any issues, open a GH Issue or reach out directly.

Last but not least: there is no best solution, only learning more and better Python. Good luck!


Keep Calm and Code in Python!

-- Bob and Julian

>>> next(PyBites)

Get our 'Become a Better Python Developer' cheat sheet sent straight to your inbox by signing up for our Newsletter: