tedlaz / hash2image

Create images from hashes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hash2image

Create images from hashes.

icon examples

This is an adaptation of Colin Davis' code at Robohash.org

Installation

1. Docker

From dockerhub:

$ docker run -d -p 8099:8099 tedlaz/hash2image

or by yourself:

$ git clone https://github.com/tedlaz/hash2image.git
$ cd hash2image
$ docker build -t hash2image .
$ docker run -d -p 8099:8099 hash2image

In either case open your browser at:

localhost:8099/"Your text to hash and image"?size=300

and you will get a nice image unique for this text.

2. Command line

$ git clone https://github.com/tedlaz/hash2image.git
$ cd hash2image
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python

and from python:

import hash2image as hi
hi.hash2image('your text here', 'coats', size=450)

and you will get a 450x450 image

or from from python tornado server:

$ python webfront.py

and open your browser at http://localhost:8099/"your text here"

Possible values for parameter set

Image sets and licenses

Image2hash comes with six image sets:

  • robots by zikri kader under CC-BY-3.0 or CC-BY-4.0 license.
  • monsters by Hrvoje Novakovic under CC-BY-3.0 license.
  • robot faces by Julian Peter Arias under CC-BY-3.0 license.
  • cats by David Revoy under CC-BY-4.0 license.
  • people by Pablo Stanley, free for personal and commercial use.
  • coats of arms, free for personal and commercial use.

About

Create images from hashes

License:MIT License


Languages

Language:Python 94.7%Language:Dockerfile 4.8%Language:Shell 0.5%