{"id":18413156,"url":"https://github.com/pybites/pillow-flask","last_synced_at":"2025-04-07T11:32:21.145Z","repository":{"id":47226060,"uuid":"100418902","full_name":"pybites/pillow-flask","owner":"pybites","description":"Code for https://pybit.es/pillow-banner-image.html","archived":false,"fork":false,"pushed_at":"2022-12-08T00:42:33.000Z","size":2238,"stargazers_count":10,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-22T17:11:32.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pybites.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-15T20:59:05.000Z","updated_at":"2021-08-19T14:22:23.000Z","dependencies_parsed_at":"2023-01-24T04:00:51.629Z","dependency_job_id":null,"html_url":"https://github.com/pybites/pillow-flask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybites%2Fpillow-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybites%2Fpillow-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybites%2Fpillow-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pybites%2Fpillow-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pybites","download_url":"https://codeload.github.com/pybites/pillow-flask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247644670,"owners_count":20972338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T03:44:59.196Z","updated_at":"2025-04-07T11:32:20.199Z","avatar_url":"https://github.com/pybites.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PyBites Banner Generator\n\n*Submission project for PyBites Code Challenge 31 - Image Manipulation With Pillow*\n\nI 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.\n\nIt takes an existing PyBites logo as the first image, and downloads (caches) the second image. \n\n*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.\n\nThe 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](https://pybit.es/pillow-banner-image.html)).\n\n#### Example 1. - make a PyBites Code Challenge banner\n\n1. Choose *challenge* as first image, provide URL to the second image, add banner text, disable *Use Second Image as Background?*:\n\n\t![example1a.png](assets/readme/example1a.png)\n\n2. Click *Generate banner*:\n\n\t![example1b.png](assets/readme/example1b.png)\n\n3. Right-click and save the image.\n\n#### Example 2. - make a PyBites News banner\n\n1. Choose *news* as first image, provide URL to the second image, add banner text, leave *Use Second Image as Background?* enabled:\n\n\t![example2a.png](assets/readme/example2a.png)\n\n2. Click *Generate banner*:\n\n\t![example2b.png](assets/readme/example2b.png)\n\n3. Right-click and save the image.\n\n### PyBites articles:\n\n* [Using Pillow to Create Nice Banners For Your Site](https://pybit.es/pillow-banner-image.html)\n\n* This week I will write a part 2 how I wrapped the original `banner.py` (command line) script into this Flask app. If I don't get to update this readme, the previous article will link to it ...\n\n### Try it yourself\n\nI deployed the app to Heroku using [Julian's nice tutorial](https://pybit.es/deploy-flask-heroku.html). You can try it out [here](https://pybites-banners.herokuapp.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybites%2Fpillow-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpybites%2Fpillow-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpybites%2Fpillow-flask/lists"}