No commit activity in last 3 years
No release in over 3 years
A Ruby library for generating identicon. https://github.com/swdyh/quilt
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

quilt

sample02 sample03 sample04 sample05

Build Status

A Ruby library for generating identicon.

Identicon: http://en.wikipedia.org/wiki/Identicon

Updates

2014-11-09T00:44:08+09:00 Add SVG support 2014-11-03T02:05:32+09:00 Add transparent background option

Installation

Required rmagick or ruby-gd. (default rmagick)

gem install quilt

Example

# input: any string
# output: 15 * 15 png (default)
identicon = Quilt::Identicon.new 'sample'
identicon.write 'sample15_15.png'

# input: identicon code(32 bit integer)
# output: 15 * 15 png (default)
identicon = Quilt::Identicon.new 1, :type => :code
identicon.write 'sample15_15_code.png'

# input: ip address
identicon = Quilt::Identicon.new '100.100.100.100', :type => :ip
identicon.write 'sample15_15_ip.png'

# output: 150 * 150 png
identicon = Quilt::Identicon.new 'sample', :scale => 10
identicon.write 'sample150_150.png'

# output: blob
identicon = Quilt::Identicon.new 'sample'
print identicon.to_blob

# output: 150 * 150 png tranparent background
identicon = Quilt::Identicon.new 'sample', :scale => 10,  :transparent => true
identicon.write 'sample_t_150_150.png'

# output: 150 * 150 svg
identicon = Quilt::Identicon.new 'sample', :scale => 10, :format => 'svg'
identicon.write 'sample_150_150.svg'

# output: 150 * 150 svg tranparent background
identicon = Quilt::Identicon.new 'sample', :scale => 10,  :transparent => true, :format => 'svg'
identicon.write 'sample_150_150_t.svg'

# change image library to Rmagick to GD
Quilt::Identicon.image_lib = Quilt::ImageGD
identicon = Quilt::Identicon.new 'sample'
identicon.write 'sample15_15_gd.png'

Information

Copyright (c) 2008 swdyh The MIT License https://github.com/swdyh/quilt