GitXplorerGitXplorer
p

pillow-flask

public
10 stars
1 forks
4 issues

Commits

List of commits on branch master.
Verified
1e17c72f72f3b1b486b17078866d4fc71a071d18

Merge pull request #5 from pybites/dependabot/pip/urllib3-1.24.2

ppybites committed 5 years ago
Verified
3f666b1ceaa61affbaaada5b76bfe92fb887f86c

Bump urllib3 from 1.22 to 1.24.2

ddependabot[bot] committed 5 years ago
Verified
08cf6f76152fec998962a83550cc1eae792947dd

Merge pull request #4 from pybites/dependabot/pip/flask-1.0

ppybites committed 5 years ago
Verified
6bbacb5a688cba2bf587f957dc52e340980ceeaf

Bump flask from 0.12.2 to 1.0

ddependabot[bot] committed 5 years ago
Verified
d09ecf7cce0dc0bbc29ef979cd6db72118496cbb

Merge pull request #3 from pybites/dependabot/pip/requests-2.20.0

ppybites committed 5 years ago
Verified
28fa068d848b56ba5f95a85e69e973db8634a048

Bump requests from 2.18.3 to 2.20.0

ddependabot[bot] committed 5 years ago

README

The README file for this repository.

PyBites Banner Generator

Submission project for PyBites Code Challenge 31 - Image Manipulation With Pillow

I made this utility to create quick but nice banners for PyBites Articles / Challenges / News / Special. However I think the code can easily be extended or modified to use it for your own needs.

It takes an existing PyBites logo as the first image, and downloads (caches) the second image.

Text for Banner is for the text to be put on the banner. SourceSansPro-Regular.otf gave me a weird char for newline (\n) so I switched to Ubuntu-R.ttf. Of course you could build this out to also let the user choose the font type and more things. The underlying banner.py script should make this easy: all font settings are collected into a namedtuple before passing it to the image creating class.

The last option of the form controls the location of the second image titled Use Second Image as Background?. By default this is turned on and the second image serves as a background image (example 2). If you disable it, the image will be resized to thumbnail and aligned to the right (example 1 / as in the article).

Example 1. - make a PyBites Code Challenge banner

  1. Choose challenge as first image, provide URL to the second image, add banner text, disable Use Second Image as Background?:

    example1a.png

  2. Click Generate banner:

    example1b.png

  3. Right-click and save the image.

Example 2. - make a PyBites News banner

  1. Choose news as first image, provide URL to the second image, add banner text, leave Use Second Image as Background? enabled:

    example2a.png

  2. Click Generate banner:

    example2b.png

  3. Right-click and save the image.

PyBites articles:

Try it yourself

I deployed the app to Heroku using Julian's nice tutorial. You can try it out here.