pixitar
Version, currently master branch1 version
- master branchlatestJan 21, 2026
github.com/dcalixto/pixitar
Pixitar generates random pixel avatars in Crystal
Installation
# Add this to your shard.yml
dependencies:
pixitar:
github: dcalixto/pixitar
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.0.0- License
- MIT
- Author
- Daniel Calixto
Dependencies
Runtime Dependencies
- kemal*github: kemalcr/kemal
- stumpy_png*github: stumpycr/stumpy_png
Development Dependencies
- spectator*github: icy-arctic-fox/spectatordev
README
Pixitar
![]()
Pixitar is an avatar generator library written in Crystal. It allows for the generation of random avatars, as well as custom male or female avatars.
Inspired by 8biticon (author of the original image assets)
Installation
Add this to your application's shard.yml:
dependencies:
pixitar:
github: dcalixto/pixitar
Then run the following command to install the dependencies:
shards install
Usage
Import the library
require "pixitar"
Create an avatar generator
avatar = Pixitar::Avatar.new
Generate a random avatar (male or female)
To generate a random avatar:
avatar = Pixitar::Avatar.new.generate_avatar
This will generate a random male or female avatar and save it with an auto-generated filename (e.g., avatar_xfal_2741.png).
Generate male avatar with custom filename To generate a male avatar and save it to a specific filename:
avatar = Pixitar::Avatar.new.generate_avatar(:male, "avatar.png") # Saves as avatar.png
Generate a female avatar with a custom filename To generate a female avatar and save it to a specific filename:
avatar = Pixitar::Avatar.new.generate_avatar(:female, "avatar_female.png") # Saves as avatar_female.png
Generate male or female avatars directly To generate male or female avatars directly:
avatar.male_avatar # Generates and saves a male avatar to an auto-generated filename
avatar.female_avatar # Generates and saves a female avatar to an auto-generated filename
Web Server Usage To serve avatars via a web server:
Import the necessary libraries:
require "pixitar"
require "pixitar/web"
Run the web server:
Pixitar::Web.run
Access avatars via HTTP: You can generate and download avatars by making HTTP requests:
GET /avatar/male - Generate a male avatar
GET /avatar/female - Generate a female avatar
Example Web Server
require "pixitar"
require "pixitar/web"
Pixitar::Web.run
Development
To work on Pixitar locally, follow these steps: Install dependencies
shards install
Run tests
crystal spec
Contributing
- Fork it (https://github.com/dcalixto/pixitar/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
Daniel Calixto - creator and maintainer
License
This shard is available as open source under the terms of the MIT License.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jan 21, 2026
- Crystal
>= 1.0.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dcalixto/pixitar
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 23, 2026
- Synced
- Sep 22, 2026
- Versions
- 1