ScreenshotNeo

BlogHow-to

How to Save an Image as an ICO File

Convert PNG, JPEG, or other images to a compatible multi-size ICO file with GIMP or ImageMagick, including transparency, favicon, and troubleshooting guidance.

By the ScreenshotNeo team1 October 20267 min read

To save an image as an ICO file, export it as Microsoft Windows Icon from GIMP, or convert it with ImageMagick. An ICO file can contain several image sizes, so a useful icon normally includes 16, 32, 48, and 256 pixel versions instead of relying on one bitmap being scaled everywhere.

Choose the workflow that fits your job:

  • GIMP: best when you want to inspect the artwork and choose export settings visually.
  • ImageMagick: best for repeatable command-line conversion and batch jobs.

What an ICO file contains

ICO is a container that can hold multiple icon images at different dimensions and color depths. Windows commonly uses 16×16, 32×32, 48×48, and 256×256 resources, selecting an appropriate image for the current context. Supplying those sizes reduces blur caused by enlarging a small bitmap. Microsoft’s icon documentation describes these typical resource sizes.

Transparency is stored in the image data. Renaming photo.png to photo.ico does not convert it and will not create an alpha channel.

Before you export

  1. Keep the original image. Export a copy so you can change dimensions or transparency later.
  2. Use a square canvas when possible. A wide photograph will be cropped or padded if it must fit a square icon.
  3. Check the artwork at 16×16 and 32×32. Fine text, thin lines, and subtle shadows may disappear.
  4. Decide whether the destination needs transparency. Remove a background in your image editor before exporting if you need an irregular silhouette.
  5. Identify the consuming software. Some programs accept PNG-compressed data inside ICO files and others do not.

Method 1: Save an image as ICO in GIMP

GIMP 3.2 includes a Microsoft Windows Icon export format. Menu wording can vary with your operating system language or a later GIMP release, but the workflow remains the same.

Step-by-step

  1. Open the image in GIMP.
  2. If needed, make the canvas square with Image → Canvas Size, then position the artwork and fill the new area with transparency or a background color.
  3. Choose File → Export As.
  4. Enter a filename ending in .ico, such as app-icon.ico.
  5. Choose Microsoft Windows Icon if GIMP does not select it automatically.
  6. In the ICO export dialog, select the sizes and color depths required by the target application.
  7. Use 32 bits per pixel with 8-bit alpha when you need normal full-color transparency. GIMP’s documentation identifies this as the common choice.
  8. Click Export, then inspect the resulting file in the application that will use it.

GIMP ICO settings explained

Setting Use it when Trade-off
1, 4, or 8 bits per pixel You need a small, indexed-color icon or compatibility with an older consumer. Fewer colors and less smooth transparency.
24 bpp with 1-bit alpha The target supports simple on/off transparency. Pixels are either transparent or opaque; there is no soft edge.
32 bpp with 8-bit alpha You need full color and smooth transparent edges. Usually larger than indexed formats.
PNG-compressed image data The target application explicitly supports PNG-compressed ICO entries. Not every program can read this encoding, so verify it before shipping.

GIMP’s export documentation covers the Microsoft Windows Icon dialog, including the available color depths and the PNG-compression compatibility warning.

Method 2: Convert an image to ICO with ImageMagick

Install ImageMagick, place the source image in your working directory, and run the documented multi-size conversion command:

magick input.png -define icon:auto-resize="256,128,96,64,48,32,16" output.ico

Replace input.png with your source path and output.ico with the destination path. The command asks ImageMagick to create several icon images in one ICO file. ImageMagick describes magick as its format-conversion and resizing command.

Useful ImageMagick variations

# Convert a JPEG and write a multi-size ICO
magick photograph.jpg -define icon:auto-resize="256,128,96,64,48,32,16" site.ico

# Preserve an alpha-capable PNG and create the icon
magick logo.png -define icon:auto-resize="256,128,96,64,48,32,16" app.ico

# Inspect the generated icon's entries
magick identify app.ico

Available input formats and exact behavior depend on how ImageMagick was built. If a command fails, confirm that your installation can read the source format and that the output directory is writable. See ImageMagick’s format examples and command-line documentation.

Choosing sizes and quality

For a general Windows icon, include 16, 32, 48, and 256 pixels. Adding 64, 96, 128, or 256 pixel entries can help contexts that display larger icons. More entries increase file size but let the operating system use a closer native size.

  • 16×16: task lists, small controls, and dense lists. Remove detail that cannot survive this size.
  • 32×32: common desktop and file-list usage.
  • 48×48: medium icon views.
  • 256×256: large views and high-resolution displays. Use the cleanest source artwork here.

Do not assume that a single 256 pixel image will look good when reduced. If the icon is important, design or review each size so the silhouette and contrast remain clear.

ICO for a website favicon

An ICO favicon can contain multiple sizes, and many browsers also accept other image formats. If you use ICO, place it at a stable public URL and reference it from the document head:

<link rel="icon" href="/favicon.ico" sizes="any">

Test the favicon in the browsers and deployment environment that matter to you. Browser support and caching behavior can differ, so do not treat an ICO export as proof that every client will display it identically.

Or skip the browser setup

If your real task is collecting images of web pages for documentation, previews, or an icon-generation pipeline, ScreenshotNeo returns a screenshot or PDF from one API request. Its capture options include PNG, JPEG, and WebP output, full-page screenshots, element selection, custom CSS and JavaScript, device presets, dark mode, and transparent backgrounds. The response identifies whether the page was cleanly captured and whether it was billed.

Use the API directly or through its MCP server for Claude, Cursor, and other MCP clients. The API documentation is at screenshotneo.com/docs.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://stripe.com \
  -o shot.webp

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const buffer = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', buffer);

Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response reports the page verdict and billing status. Plans include 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Troubleshooting

Symptom Likely cause Fix
The file is still a PNG or JPEG The extension was renamed instead of exporting or converting the data. Use GIMP’s ICO export or run ImageMagick.
Transparency appears as black or white The source has no alpha channel, or the selected ICO depth has limited alpha support. Remove the background, confirm the source includes alpha, and export as 32 bpp with 8-bit alpha.
The icon looks blurry Only one small image was scaled up, or the artwork has detail that does not survive reduction. Include multiple native sizes and simplify the 16×16 and 32×32 designs.
The target program rejects the ICO It may not support PNG-compressed ICO entries or the chosen color depth. Disable PNG compression and try a conventional 32 bpp entry, then test in the target program.
magick is not found ImageMagick is not installed or its executable is not on PATH. Install ImageMagick, reopen the terminal, and run magick -version.
ImageMagick cannot read the input The installed build lacks a decoder for that format, or the path is wrong. Check the path, run magick identify input.ext, and convert the source to PNG first if necessary.
The favicon does not update The browser or CDN is serving a cached icon. Change the filename or query string, clear the relevant cache, and test in a private window.

Performance, reliability, and file size

  • More embedded sizes improve display quality but increase the ICO file size. Include the sizes your application actually uses.
  • Indexed color can reduce size, but 32-bit alpha usually gives smoother edges and fewer surprises.
  • For automated builds, pin the ImageMagick version and inspect generated files so a dependency update does not change output unexpectedly.
  • Always open the ICO in the final application. A successful export only proves that a file was written; it does not prove that every consumer supports its encoding.
  • Keep the source artwork and conversion command together so you can regenerate the icon consistently.

FAQ

Can I convert any image directly to ICO?

Most common raster formats can be converted if your editor or ImageMagick build supports decoding them. Vector artwork may need to be rasterized first.

Is PNG or ICO better for a favicon?

Both may be accepted. ICO is useful when you want several sizes in one file, while PNG can be simpler for a single known size. Follow the requirements of your site and target clients.

Should every ICO include 256×256?

It is useful for large Windows views, but it is not a substitute for smaller entries. Include the sizes your target environment displays.

Why does renaming an extension fail?

An extension tells software what to try; it does not rewrite the file’s internal format. Export or convert the image so the ICO container and image entries are actually created.