What does the ICO to PNG Converter do?
The ICO to PNG Converter transforms Windows Icon (.ico), Cursor (.cur), and website Favicon files into universal, high-resolution 32-bit lossless Portable Network Graphics (PNG) images with alpha transparency preservation, custom resolution scaling, and dimension overrides.
ICO files often contain multiple embedded resolution layers (e.g. 16x16, 32x32, 48x48, 64x64, 128x128, 256x256) encapsulated in a proprietary Windows binary format. Converting ICO to PNG extracts the highest resolution icon raster and packages it as an industry-standard PNG image suitable for web interfaces, mobile apps, and graphic design projects.
Core Concepts
- ICONDIR & ICONDIRENTRY Binary Parsing: Reads the icon directory header to determine embedded resolution layers, color depths, and byte offsets.
- Multi-Frame High-Resolution Layer Extraction: Automatically selects the highest pixel density layer available in multi-resolution icons.
- Alpha Mask & 32-bit ARGB Preservation: Preserves clean alpha blending and binary bitmasks without jagged black or white background artifacts.
- Resolution Scaling (@2x / @3x / @4x): Upscales icon matrices to higher density with smooth bilinear canvas resampling.
How to use the tool?
- Upload ICO Icon or Paste Base64: Drag and drop a
.icoor.curfile into the dedicated drop zone, or paste a Base64 ICO string into the editor. - Select Resolution Scale: Choose
1x (Original Size),2x (@2x Retina HD),3x (@3x Ultra), or4x (@4x High Res). - Optional Dimension Overrides: Set custom pixel
WidthorHeightoverrides if specific pixel dimensions are required. - Convert to PNG: Click Convert to PNG to render your lossless PNG output.
- Download or Copy: Click Download to save your
.pngfile or Copy the Base64 Data URI.
Related Developer Utilities
- BMP to PNG Converter — Convert uncompressed Windows Bitmap graphics to PNG.
- WebP to PNG Converter — Convert modern WebP graphics to PNG.
- AVIF to PNG Converter — Convert next-generation AVIF images to PNG.
- SVG to PNG Converter — Rasterize Scalable Vector Graphics into crisp PNG assets.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/image/ico-to-png) for programmatic validation, ICO dimension parsing, and PNG Data URI formatting.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String | Raw Base64 string or Data URI of the ICO icon. | "data:image/x-icon;base64,AAABAAE..." |
options.scale |
Number | Multiplier scale factor (1, 2, 3, 4). Default is 1. |
2 |
options.width |
Number | Optional target width in pixels. | 256 |
options.height |
Number | Optional target height in pixels. | 256 |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/image/ico-to-png \
-H "Content-Type: application/json" \
-d '{
"rawText": "data:image/x-icon;base64,AAABAAEAAQEAAAEAIACAAQAAFgAAACgAAAABAAAAAQAAAAEAGAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAA",
"options": {
"scale": 1
}
}'Python
import requests
url = "https://blueutils.com/api/image/ico-to-png"
payload = {
"rawText": "data:image/x-icon;base64,AAABAAEAAQEAAAEAIACAAQAAFgAAACgAAAABAAAAAQAAAAEAGAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAA",
"options": {
"scale": 1
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"rawText": "data:image/x-icon;base64,AAABAAEAAQEAAAEAIACAAQAAFgAAACgAAAABAAAAAQAAAAEAGAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAA",
"options": {
"scale": 1
}
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/image/ico-to-png"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether the ICO was parsed successfully. | true |
mimeType |
String | Target output MIME type (image/png). |
"image/png" |
originalFormat |
String | Detected input MIME type (image/x-icon). |
"image/x-icon" |
dataUri |
String | Base64 PNG Data URI string. | "data:image/png;base64,..." |
metadata.originalWidth |
Number | Original width in pixels of the highest-resolution icon layer. | 256 |
metadata.originalHeight |
Number | Original height in pixels of the highest-resolution icon layer. | 256 |
metadata.targetWidth |
Number | Scaled target pixel width. | 256 |
metadata.targetHeight |
Number | Scaled target pixel height. | 256 |
metadata.scale |
Number | Scale factor applied. | 1 |
metadata.frameCount |
Number | Total number of embedded icon sizes in the container. | 3 |
snippets.html |
String | Ready-to-use HTML <img> tag. |
"<img src=\"...\" />" |
snippets.css |
String | Ready-to-use CSS background-image declaration. |
"background-image: url(\"...\");" |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"mimeType": "image/png",
"originalFormat": "image/x-icon",
"dataUri": "data:image/png;base64,AAABAAE...",
"base64": "AAABAAE...",
"metadata": {
"originalWidth": 256,
"originalHeight": 256,
"targetWidth": 256,
"targetHeight": 256,
"scale": 1,
"frameCount": 3,
"bitDepth": "32-bit",
"aspectRatio": 1,
"originalSizeBytes": 15086,
"formattedSize": "14.7 KB"
},
"snippets": {
"html": "<img src=\"data:image/png;base64,...\" width=\"256\" height=\"256\" alt=\"Converted PNG Icon\" />",
"css": "background-image: url(\"data:image/png;base64,...\");",
"markdown": ""
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Invalid format: Expected a valid Windows Icon (ICO container or data:image/x-icon)."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to convert ICO to PNG?
Automating ICO conversion via API in build workflows and asset pipelines offers major benefits:
- Extract High-Res Favicons: Extract 128px and 256px raster artwork from legacy favicon
.icofiles for responsive touch icons (apple-touch-icon.png). - Optimized Token Efficiency for AI Agents: Extracts clean image dimensions and frame count before sending image data to multimodal vision agents.
- Deterministic Pipeline Integration: Enables automated CI/CD release scripts to convert application desktop icons into web assets.
Native Usage
How to convert ICO to PNG locally using command-line tools:
Windows (CMD / PowerShell)
# PowerShell: Convert ICO to PNG using ImageMagick
magick "favicon.ico[0]" "output.png"Linux / Unix (Bash / Shell)
# Bash: Convert ICO to PNG using icoutils (icotool)
icotool -x -o . favicon.ico
# Or using ImageMagick:
convert favicon.ico[0] output.pngPython
# Python using Pillow (PIL)
from PIL import Image
image = Image.open('favicon.ico')
image.save('output.png', 'PNG')
print("Converted favicon.ico to output.png successfully")Java
// Java using ImageIO (with TwelveMonkeys ImageIO ICO plugin)
import java.io.File;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class IcoToPng {
public static void main(String[] args) throws Exception {
BufferedImage inputImage = ImageIO.read(new File("favicon.ico"));
ImageIO.write(inputImage, "png", new File("output.png"));
System.out.println("Converted favicon.ico to output.png successfully");
}
}