Imgix APIsRendering APIFormatIcon Sizes

Icon Sizes

ico-sizes

The ico-sizes parameter packs several sizes into a single fm=ico file. ICO is the one output format that can hold more than one image, which is what lets a single favicon.ico serve a browser tab, a bookmark bar and a desktop shortcut at their native sizes instead of a scaled one.

Pass up to 8 comma-separated sizes, each from 1 to 256. Every value is a target size in pixels for the icon’s longer edge:

https://assets.imgix.net/examples/blue-pineapple-no-background.png?fit=crop&ar=1:1&fm=ico&ico-sizes=16,32,48

That request produces one file holding all three images below, each shown here at its real size.

ico-sizes=16
sandbox-demo
ico-sizes=32
sandbox-demo
ico-sizes=48
sandbox-demo

Accepted values

Invalid input is never an error — unusable values are dropped and the rest of the request is honored.

InputResult
ico-sizes=48A single 48 px entry
ico-sizes=16,32,48Three entries in one file
ico-sizes=16,16,32Duplicates collapsed, so two entries rather than three
ico-sizes=16,300,32Values outside 1–256 dropped, leaving two entries
More than 8 sizesOnly the first 8 are kept
ico-sizes=abcUnparseable, so one icon at the output size
No ico-sizesOne icon at the output size

Aspect ratio

Aspect ratio is preserved rather than forced square, so a wide logo packed at 48 is 48 px on its longer edge — ico-sizes=16,32,48 on a 3:2 source gives entries of 16x11, 32x21 and 48x32. For true square icons, crop the source first with fit=crop and a square ar, as the example above does.

ico-sizes does not appear in the X-Imgix-Params response header.