GithubHelp home page GithubHelp logo

banhammer's Introduction

Tom Scott Banhammer Generator

Generates GIFs based on Tom Scott's Banhammer

Want to use this in any project using Docker? Get the Docker container here: https://gitlab.com/nerd3-servers/banhammer-generator

Installing

Python 3.5+ is required

To install the library, simply run the following command:

pip install banhammer

If you would like to use a pillow drop-in replacement, such as pillow-simd, then install that prior to installing the banhammer. All requirements should automatically install.

Usage

banhammer.Generator() is the main generator object. To generate an image, use Generator().image_gen(str) where str is your string of choice. This will return an io.BytesIO() object, which you can then manually write to a file or upload somewhere.

Example

The following example generates a GIF and saves it to a file called output.gif:

from banhammer import Generator

# Setup the generator
g = Generator()

# Generate the GIF (returns a BytesIO object)
im = g.image_gen('Example')

# Write the image to a file called output.gif
f = open('output.gif', 'wb')
f.write(im.read())
f.close()

The resulting GIF looks something like this:

Font Licensing

The font file included is a modified version of the Bungee Regular font. The font has been modified to include missing unicode characters and emoji provided by other fonts. The licensing and source information can be found below.

Font Designers Licenses
Bungee Regular David Jonathan Ross SIL Open Font License
Twitter Color Emoji SVGinOT Font Brad Erickson, Joe Loughry, Terence Eden, Twitter, Inc and collaborators Massachusetts Institute of Technology License
Creative Commons Attribution 4.0 International
DejaVu Sans Mono Štěpán Roh and authors, Bitstream, Inc, Tavmjung Bah Massachusetts Institute of Technology License
Tetsubin Gothic フォントな自由 Apache License 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.