Giter VIP home page Giter VIP logo

bvatar's Introduction

Bvatar - Random Art Avatars

Bvatar creates a unique 8x8 graphical representation of a string.

Setup

Install from PYPI

For a full install (to be able to create bitmap images), use the following pip command:

pip install bvatar[bitmap]

Or, if for some reason you only want to output ascii bvatars, just use: pip install bvatar

Install development version

Download from github and install the development version with these commands:

git clone https://github.com/smileychris/bvatar
cd bvatar
pip install -e .[bitmap]

Usage

Import the bvatar class and use it like so:

from bvatar import Bvatar
bvtr = Bvatar('text')
img = bvtr.image()
img.save('some_file.png', 'PNG')

Command-line Script

Generate a Bvatar (an 8x8 randomart avatar).

Usage:

bvatar [--mirror] [--no-color] [--px-size=<int>] ([TEXT] | [--hash=<sha1_hash>])
bvatar --ascii [--mirror] [--spaced] [--no-border] ([TEXT] | [--hash=<sha1_hash>])

The first format is for generating bitmap images. By default, the image is only displayed and not stored. To save the image, pipe to a file:

bvatar > some_file.png

Arguments:

TEXT

bvatar source text (otherwise a random bvatar is generated)

Options:

--mirror

generate a horizontally mirrored bvatar

--ascii

output ascii rather than generating a bitmap image

--hash=<sha1_hash>

rather than passing the text and having it SHA1ed, you can pass a hex encoded SHA1 hash explicitly

Extra options when generating an image (i.e. not using--ascii):

--saturation

color saturation (use 0 for greyscale image) [default: 0.75]

--fill

fill background with lightest tone of the bvatar's color

--px-size=<int>

actual size for each pixel [default: 16]

Extra options when using --ascii:

--spaced

a "lighter" ascii art alternative

--no-border

don't add a border around the ascii art

bvatar's People

Contributors

livibetter avatar smileychris avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.