All Projects → DannyBen → icodi

DannyBen / icodi

Licence: MIT license
Deterministic Random SVG Icon Generator

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to icodi

identicon-api
A simple API to retrieve SVG identicons
Stars: ✭ 15 (-16.67%)
Mutual labels:  identicon, avatar-generator, identicon-generator, avatar-placeholder
minidenticons
Super lightweight SVG identicon (icon avatar) generator
Stars: ✭ 89 (+394.44%)
Mutual labels:  identicon, avatar-generator, identicon-generator
identicon
Original Identicon java and canvas implementations
Stars: ✭ 64 (+255.56%)
Mutual labels:  identicon, identicon-generator
monsterid
MonsterID adaptation for Composer and modern PHP versions
Stars: ✭ 20 (+11.11%)
Mutual labels:  avatar-generator, avatar-placeholder
go-qidenticon
qidenticon (identicon generator from Bitmessage) ported to Go
Stars: ✭ 12 (-33.33%)
Mutual labels:  identicon, identicon-generator
BlockiesSwift
Unique blocky identicons generator for Swift
Stars: ✭ 53 (+194.44%)
Mutual labels:  identicon, identicon-generator
boring-avatars
Boring avatars is a tiny JavaScript React library that generates custom, SVG-based avatars from any username and color palette.
Stars: ✭ 3,582 (+19800%)
Mutual labels:  avatar-generator, avatar-placeholder
monsterID
The original MonsterID implementation
Stars: ✭ 56 (+211.11%)
Mutual labels:  identicon, avatar-generator
pixitar
🧝 Pixitar is an avatar generation library written in Ruby.
Stars: ✭ 20 (+11.11%)
Mutual labels:  gem, avatar-generator
AvatarImageGenerator
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice
Stars: ✭ 61 (+238.89%)
Mutual labels:  avatar-generator, avatar-placeholder
react-nice-avatar
react library for generating avatar
Stars: ✭ 700 (+3788.89%)
Mutual labels:  avatar-generator, avatar-placeholder
annoy.rb
annoy-rb provides Ruby bindings for the Annoy (Approximate Nearest Neighbors Oh Yeah).
Stars: ✭ 23 (+27.78%)
Mutual labels:  gem
nanook
Ruby library for making and receiving payments and managing a nano currency node
Stars: ✭ 17 (-5.56%)
Mutual labels:  gem
create-chakra-icons
Transform SVGs to React Chakra UI <Icon /> ✨
Stars: ✭ 80 (+344.44%)
Mutual labels:  svg-generator
secs4java8
This library is SEMI-SECS-communicate implementation on Java8.
Stars: ✭ 46 (+155.56%)
Mutual labels:  gem
ascii85gem
A simple gem that provides methods for encoding/decoding Adobe’s binary-to-text encoding of the same name.
Stars: ✭ 18 (+0%)
Mutual labels:  gem
react-peeps
React implementation of the Open Peeps
Stars: ✭ 42 (+133.33%)
Mutual labels:  avatar-generator
Identicon
Identicon generator written in golang
Stars: ✭ 17 (-5.56%)
Mutual labels:  identicon-generator
make model searchable
Adds simlpe search functionality to models
Stars: ✭ 27 (+50%)
Mutual labels:  gem
best buy ruby
Ruby library for the BestBuy API. https://www.bestbuy.com
Stars: ✭ 21 (+16.67%)
Mutual labels:  gem

logo

Icodi - Deterministic Random SVG Icon Generator

Gem Version Build Status Maintainability


Generate repeatable random SVG icons from any string, similar to GitHub identicons.


Table of Contents

Installation

$ gem install icodi

Demo

Visit the Icodi Playground to experiment with the parameters.

Examples

Grid: 5x5, Mirror: X (default settings)

strip1

Grid: 6x6, Mirror: Y, Stroke: 4

strip2

Grid: 8x8, Stroke: 7, Density: 0.3

strip3

Grid: 7x7, Mirror: X/Y, Stroke: 3, Density: 0.8

strip4

Grid: 5x5, Jitter: 0.9, Stroke: 2

strip4

Increasing Stroke: 0.1 - 5.0

strip5

Increasing Density: 0.3 - 0.8

strip6

Increasing Jitter: 0 - 1.0

strip6

Mirror Styles: X, Y, Both, None

strip7

Usage

This is the general usage pattern:

require 'icodi'

# initialize with optional text and options
icon = Icodi.new text, options

# get the SVG string
icon.render

# or save to SVG file
icon.save 'logo'

Generate a random icon with the default options, and save it to icon.svg:

icon = Icodi.new
icon.save 'icon'

Generate persistent random icon (same input generates the same output):

icon = Icodi.new "any string"
icon.save 'icon'

Options

Options can be provided as the first or second argument:

Icodi.new "any string", pixels: 8, density: 0.3
Icodi.new pixels: 8, density: 0.3, stroke: 2
Parameter Default Type Description
pixels 5 Integer Grid size.
mirror :x Symbol Mirroring mode: :x, :y, :both or :none.
color Deterministic Random String A color string for the pixels.
density 0.5 Float A value between 0 and 1 representing the chance for a pixel to be drawn. Lower values mean less pixels.
stroke 0.1 Float Width of the border around each pixel. Note that each pixel is a 10x10 box, so a stroke of 1 means it will take 10% of the box. Higher values generate more overlap between the pixels.
jitter 0 Float A value between 0 and 1 representing the chance for a pixel to be dislocated by half of its size in a random direction.
background #fff String A named SVG color string (blue, yellow etc.) or RGB color (for example #dddddd).
id icodi String The ID to assign the SVG object. Normally this should not matter, but if you intend to embed this icon in an HTML, or in another SVG, this can be useful.
template :default Symbol/String SVG template to use. Can be :default, :html or a path to a file. Read more on Victor SVG Templates.

Using with Sinatra

To create a Sinatra server that serves Icodi images, see the config.ru example code.

Contributing / Support

If you experience any issue, have a question or a suggestion, or if you wish to contribute, feel free to open an issue.


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].