func GenerateFileForUsername(gender Gender, username string, filePath string) error {
	img, err := GenerateForUsername(gender, username)
	if err != nil {
		return err
	}
	return saveToFile(img, filePath)
}
GenerateFileForUsername generates avatar for username and save it to specified file.
Image format depends on file extension (jpeg, jpg, png, gif). Default is png
package govatar
import (
	"bytes"
	"embed"
	"errors"
	"hash/fnv"
	"image"
	"image/draw"
	"image/gif"
	"image/jpeg"
	"image/png"
	"io/fs"
	"math/rand"
	"os"
	"path"
	"path/filepath"
	"sort"
	"strings"
	"time"
)
var ErrUnsupportedGender = errors.New("unsupported gender")
type person struct {
	Clothes []string
	Eye     []string
	Face    []string
	Hair    []string
	Mouth   []string
}
type store struct {
	Background []string
	Male       person
	Female     person
}
var assetsStore *store
type Gender int
const (
	MALE Gender = iota
	FEMALE
)
var dataFS embed.FS
func init() {
	male := getPerson(MALE)
	female := getPerson(FEMALE)
	assetsStore = &store{Background: mustAssetsList("data/background"), Male: male, Female: female}
	rand.Seed(time.Now().UTC().UnixNano())
}
func Generate(gender Gender) (image.Image, error) {
	return GenerateForUsername(gender, time.Now().String())
}
func GenerateFile(gender Gender, filePath string) error {
	img, err := Generate(gender)
	if err != nil {
		return err
	}
	return saveToFile(img, filePath)
}
func GenerateForUsername(gender Gender, username string) (image.Image, error) {
	h := fnv.New32a()
	_, err := h.Write([]byte(username))
	if err != nil {
		return nil, err
	}
	switch gender {
	case MALE:
		return randomAvatar(assetsStore.Male, int64(h.Sum32()))
	case FEMALE:
		return randomAvatar(assetsStore.Female, int64(h.Sum32()))
	default:
		return nil, ErrUnsupportedGender
	}
}