Search code examples
phplaravelimagemagickintervention

Creating Favicon file using Intervention.io


I am trying to create a multi-resolution favicon file (*.ico) using Intervention.io (PHP library Intervention.io)? Does anyone know how to join multiple images into a .ico file? I know how its done with imagemagik

convert output-16x16.ico output-32x32.ico favicon.ico


Solution

  • Just use Imagick directly, and don't bother with Intervention.io library (at least until the API can support this action).

    $wand = new Imagick();
    $wand->addImage(new Imagick('output-16x16.ico'));
    $wand->addImage(new Imagick('output-32x32.ico'));
    $wand->writeImages('favicon.ico', true);