A rust CLI to generate favicons.
  • Rust 96%
  • Nix 4%
Find a file
2026-01-17 23:28:53 +01:00
assets fixed icon for git forge 2025-08-18 19:55:48 +02:00
src Optimize performance and reduce dependencies 2025-09-19 11:31:32 +02:00
test_files Optimize performance and reduce dependencies 2025-09-19 11:31:32 +02:00
tests Fixed path test error. 2025-08-14 19:19:24 +02:00
.gitignore Initial commit 2025-08-14 12:16:49 +02:00
BUILDING.md Reorganize documentation and bump version to 0.1.2 2025-09-19 11:43:44 +02:00
Cargo.toml Updated dependencies, without need to build new artefacts 2025-12-24 08:11:56 +01:00
CONTRIBUTING.md Reorganize documentation and bump version to 0.1.2 2025-09-19 11:43:44 +02:00
flake.nix Added flake.nix 2026-01-17 23:28:53 +01:00
LICENSE Initial commit 2025-08-14 00:19:55 +02:00
README.md Reorganize documentation and bump version to 0.1.2 2025-09-19 11:43:44 +02:00

Logo of a white image frame in a purple colored circle

Favigen

A fast and efficient CLI tool written in Rust for generating a complete set of favicons and web app icons from a single source image.

Features

  • 🎨 Multiple Input Formats: PNG, JPEG, GIF, WebP, AVIF, and SVG
  • 📱 Complete Icon Set: All standard favicon sizes (16x16 to 512x512)
  • 🌐 Web Ready: HTML snippet and web app manifest included
  • High Performance: Built with Rust for maximum speed
  • 🔧 SVG Auto-Fix: Automatically repairs common SVG formatting issues
  • 📦 Zero Dependencies: Self-contained binary with no runtime dependencies

🚀 Installation

Binary Releases

Download pre-built binaries from the releases page.

Currently available for:

  • Linux x86_64

Via Cargo

cargo install --git https://codeberg.org/Pontoporeia/favigen

From Source

For detailed build instructions, see BUILDING.md.

git clone https://codeberg.org/Pontoporeia/favigen.git
cd favigen
cargo build --release

📋 Usage

Quick Start

# Generate favicons from any supported image format
favigen logo.png
favigen logo.svg -o ./assets/icons
favigen logo.webp --output ./favicons --verbose

Command Line Options

favigen [OPTIONS] <INPUT>

Arguments:
  <INPUT>  Input image file (PNG, JPEG, GIF, WebP, AVIF, SVG)

Options:
  -o, --output <OUTPUT>  Output directory [default: ./favicons]
  -v, --verbose          Verbose output
  -h, --help            Print help
  -V, --version         Print version

Examples

# Basic usage - generates files in ./favicons/
favigen logo.png

# Custom output directory
favigen assets/brand.svg -o public/icons

# Verbose output to see generation progress
favigen logo.webp -v

# SVG with auto-fix for malformed files
favigen broken-logo.svg --verbose

📦 Generated Files

Favigen creates a comprehensive favicon package (14 files total):

🖼️ PNG Icons

  • Standard Favicons: 16×16, 32×32, 48×48, 64×64, 96×96, 128×128
  • Apple Touch Icons: 152×152 (iPad), 167×167 (iPad Pro), 180×180 (iPhone)
  • Android Icons: 192×192 (standard), 512×512 (splash screen)

📄 Configuration Files

  • favicon.ico - Multi-size ICO file (16, 32, 48, 64px)
  • site.webmanifest - Progressive Web App manifest
  • favicon_html.txt - Ready-to-use HTML snippet

📊 File Sizes

Typical output for a 512×512 source image:

  • Total package: ~150-200KB
  • Individual icons: 500B-50KB each
  • Zero quality loss from source

🌐 Integration

1. Copy Files

# Copy generated files to your website's root
cp favicons/* /path/to/your/website/

2. Add HTML Tags

Copy the contents of favicon_html.txt to your <head> section:

<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="167x167" href="/apple-touch-icon-167x167.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">

3. Customize Web App Manifest

Edit site.webmanifest for your app:

{
  "name": "Your App Name",
  "short_name": "YourApp",
  "icons": [...],
  "theme_color": "#your-color",
  "background_color": "#your-bg-color",
  "display": "standalone"
}

Browser Support

  • All modern browsers (Chrome, Firefox, Safari, Edge)
  • Mobile devices (iOS Safari, Android Chrome)
  • Progressive Web Apps (PWA)
  • Legacy browsers (via favicon.ico)

🔧 Development

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Building from Source

Detailed build instructions are available in BUILDING.md.

Dependencies

This tool uses high-quality Rust crates:

  • image - Image processing and format support
  • resvg/usvg/tiny-skia - SVG rendering engine
  • ico - ICO file generation
  • clap - Command line interface
  • serde/serde_json - Configuration serialization
  • anyhow - Error handling

📄 License

AGPL 3.0 License - see LICENSE file for details.

🎨 Credits

📞 Support


Made with ❤️ and Rust