All Projects → disintegration → Letteravatar

disintegration / Letteravatar

Licence: other
Letter avatar generation for Go

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Letteravatar

Compositionavatar
Android composition avatar. 仿QQ讨论组头像
Stars: ✭ 371 (+240.37%)
Mutual labels:  avatar
Go Adorable
Adorable Avatars from Go
Stars: ✭ 50 (-54.13%)
Mutual labels:  avatar
Android Circular Progress
Android custom view that loads a circular progress indicator using ImageView or FrameLayout
Stars: ✭ 75 (-31.19%)
Mutual labels:  avatar
Multiimageview
Android library to display a few images in one ImageView like avatar of group chat. Made by Stfalcon
Stars: ✭ 443 (+306.42%)
Mutual labels:  avatar
Jdenticon
Javascript library for generating identicons. Running in the browser and on Node.js.
Stars: ✭ 889 (+715.6%)
Mutual labels:  avatar
Cameron
An avatar generator for Go.
Stars: ✭ 66 (-39.45%)
Mutual labels:  avatar
Generate Avatar
Generate your 100% fingerprinted example avatar from id, email, username etc.
Stars: ✭ 307 (+181.65%)
Mutual labels:  avatar
Ts3admin.class
The ts3admin.class is a powerful api for communication with Teamspeak 3 Servers from your website! Your creativity knows no bounds!
Stars: ✭ 103 (-5.5%)
Mutual labels:  avatar
Jdenticon Php
PHP library for generating identicons as PNG and SVG.
Stars: ✭ 28 (-74.31%)
Mutual labels:  avatar
Network Avatar Picker
A npm module that returns user's social network avatar. Supported providers: facebook, instagram, twitter, tumblr, vimeo, github, youtube and gmail
Stars: ✭ 74 (-32.11%)
Mutual labels:  avatar
Avataaars
React component for avataaars
Stars: ✭ 494 (+353.21%)
Mutual labels:  avatar
Django Avatar
A Django app for handling user avatars.
Stars: ✭ 720 (+560.55%)
Mutual labels:  avatar
Dicebear
DiceBear is an avatar library for designers and developers.
Stars: ✭ 1,161 (+965.14%)
Mutual labels:  avatar
Gfriends
媒体服务器演员头像仓库
Stars: ✭ 400 (+266.97%)
Mutual labels:  avatar
Icotar
A free colorful icon avatar generator.
Stars: ✭ 94 (-13.76%)
Mutual labels:  avatar
React Avatar
👤 Load, crop & preview avatar with React
Stars: ✭ 361 (+231.19%)
Mutual labels:  avatar
Crystal.ttvs
Crystal TTVS engine is a real-time audio-visual Multilingual speech synthesizer with a 3D expressive avatar.
Stars: ✭ 65 (-40.37%)
Mutual labels:  avatar
Minecraft Avatar
PHP script (using GD) to generate avatar or skin from a Minecraft username
Stars: ✭ 104 (-4.59%)
Mutual labels:  avatar
Thispersondoesnotexist Js
Api for https://thispersondoesnotexist.com Generates an image of a person that does not exist in real life
Stars: ✭ 101 (-7.34%)
Mutual labels:  avatar
Docker
Docker containers for OpenCog - Robot Operating System (ROS)
Stars: ✭ 72 (-33.94%)
Mutual labels:  avatar

letteravatar

GoDoc Build Status

Letter avatar generation for Go.

Usage

Generate a 100x100px 'A'-letter avatar:

img, err := letteravatar.Draw(100, 'A', nil)

The third parameter options *Options can be used for customization:

type Options struct {
	Font        *truetype.Font
	Palette     []color.Color
	LetterColor color.Color
	PaletteKey  string
}

Using a custom palette:

img, err := letteravatar.Draw(100, 'A', &letteravatar.Options{
	Palette: []color.Color{
		color.RGBA{255, 0, 0, 255},
		color.RGBA{0, 255, 0, 255},
		color.RGBA{0, 0, 255, 255},
	},
})

Documentation

https://godoc.org/github.com/disintegration/letteravatar

Examples

package main

import (
	"image/png"
	"log"
	"os"
	"unicode/utf8"

	"github.com/disintegration/letteravatar"
)

var names = []string{
	"Alice",
	"Bob",
	"Carol",
	"Dave",
	"Eve",
	"Frank",
	"Gloria",
	"Henry",
	"Isabella",
	"James",
	"Жозефина",
	"Ярослав",
}

func main() {
	for _, name := range names {
		firstLetter, _ := utf8.DecodeRuneInString(name)

		img, err := letteravatar.Draw(75, firstLetter, nil)
		if err != nil {
			log.Fatal(err)
		}

		file, err := os.Create(name + ".png")
		if err != nil {
			log.Fatal(err)
		}

		err = png.Encode(file, img)
		if err != nil {
			log.Fatal(err)
		}
	}
}

License

The package "letteravatar" is distributed under the terms of the MIT license.

The Roboto-Medium font is distributed under the terms of the Apache License v2.0.

See LICENSE.

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].