Generate a focused, modern favicon set from one SVG or PNG source.
ALTO Favicon produces the small set of files current browsers and devices need, plus the exact HTML tags required to use them. The CLI and PHP API share the same options, preserve SVG input for modern browsers, and select an available rasterizer automatically.
vendor/bin/favicon assets/logo.svg --output public/faviconsThe default result includes icon.svg, favicon.ico,
apple-touch-icon.png, and favicon.html. Optional flags add a Web App
Manifest, Android icons, a maskable icon, and a Google Search PNG.
Install ALTO Favicon with Composer:
composer require alto/faviconALTO Favicon requires PHP 8.3 or later. SVG input needs rsvg-convert,
Inkscape, ImageMagick CLI, or the Imagick extension. PNG input needs Imagick or
GD. Composer installs the PHP package dependencies automatically.
Generate the default set from an SVG:
vendor/bin/favicon assets/logo.svg --output public/faviconsThen copy the generated contents of public/favicons/favicon.html into the
document <head>.
Add a manifest and a dedicated Google Search icon when needed:
vendor/bin/favicon assets/logo.svg \
--output public/favicons \
--public-path /favicons \
--app-name "My App" \
--manifest \
--search-png| Guide | Contents |
|---|---|
| Documentation index | Browse the complete guide set |
| Getting started | Generate and install the first favicon set |
| CLI | Commands, flags, and examples |
| PHP API | Programmatic generation and reports |
| Configuration | Options, defaults, and overwrite behavior |
| Rasterizers | SVG and PNG adapter selection |
| Generated files | Default and optional outputs |
| Errors | Input and rasterization failures |
Contributions of all kinds are welcome. Visit the project on GitHub to report a bug, suggest a feature, or open a pull request.
Before submitting code, run:
# Runs PHP CS Fixer, PHPStan, and PHPUnit
composer qaALTO Favicon is open source. You can support its continued development through GitHub Sponsors.
Sharing this package with others or starring it on GitHub is also much appreciated.
ALTO Favicon is released by ALTO PHP under the MIT License.