1 unstable release

0.1.0 Mar 4, 2023

#13 in #slug

MIT license

1.5MB
95 lines

Roucoule

An avatar generator optimised for generating random avatars based on multiple image layers, able to return same image from a string "slug". Heavily inspired by David Revoy's cat avatar generator and MonsterID by Andreas Gohr's.

This generator relies on the Image crate to do image processing.

Roucoule is a Rust Re-implementation of Pioupiou Avatar Generator python Library. This version rely on image library.

WIP. This is a project to learn rust by practice, so it's not state of the art for now.

Command-line usage:

cargo build
./target/debug/roucoule roucoule roucoule.png

cat:

cargo build
./target/debug/roucoule roucoule roucoule.png -t "sample/cat_revoy" -l "body,fur,eyes,mouth,accessorie"

monster:

cargo build
./target/debug/roucoule roucoule monster.png -t "sample/monster_id" -l "legs,hair,arms,body,eyes,mouth" -w 120 -i 120

Lib Usage

use roucoule::AvatarGenerator;
use std::path::PathBuf;

let av = AvatarGenerator{
        output_path: PathBuf::from("test.png"),
        theme_path: PathBuf::from("sample/bird_revoy/"),
        layers: "tail,hoop,body,wing,eyes,bec,accessorie".to_string(),
        width: 256,
        height: 256
};
av.generate_avatar("test");

Dependencies

~11MB
~165K SLoC