Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.11 KB

File metadata and controls

54 lines (40 loc) · 1.11 KB

goAvatar

Language Category CLI Interface API

Go package for quick generation of random pixelized avatars

examples

Example usage

From CLI

./goAvatar -s 500 -d 5

CLI Options

Short Long Required Description Default
-d --dimensions Yes Dimensions of the image
-s --size Yes File size in pixels
-o --output No Output file avatar.png

From code

package main

import (
	"image/png"
	"os"
	"testing"

	"github.com/ethercod3/goAvatar/avatar"
)

func TestMain(t *testing.T) {
	options := avatar.Options{
		Dimensions: 5,
		FileSizePx: 500,
	}
	img := avatar.Generate(options)
	file, err := os.Create("./avatar.png")
	if err != nil {
		t.Fatal(err)
	}
	png.Encode(file, img)
}