What does the AVIF to PNG Converter do?
The AVIF to PNG Converter transforms modern AV1 Image File Format (AVIF) graphics into universal, lossless Portable Network Graphics (PNG) images with alpha channel preservation, custom resolution scaling, and dimension overrides.
AVIF is a next-generation image format built on the AV1 video codec standard that provides ultra-high compression efficiency. However, many legacy web browsers, desktop graphics suites, email clients, and automated testing tools do not yet support AVIF decoding. Converting AVIF into PNG provides universal compatibility and lossless pixel fidelity.
Core Concepts
- AV1 & ISOBMFF Box Parsing: Inspects
ftyp,meta, andispe(Image Spatial Extents) container boxes to extract native pixel dimensions. - Universal Container Translation: Transforms next-generation AVIF images into standard PNG files compatible with all platforms.
- Resolution Scaling (@2x / @3x / @4x): Upscales or downsamples AVIF pixels into high-density raster canvases.
- Data URI & Code Snippet Generation: Generates copy-ready Base64 Data URIs, HTML tags, and CSS background rules.
How to use the tool?
- Upload AVIF Image or Paste Base64: Drag and drop an
.aviffile into the dedicated drop zone, or paste a Base64 AVIF string into the editor. - Select Resolution Scale: Choose
1x (Original Size),2x (@2x Retina HD),3x (@3x Ultra), or4x (@4x Print Quality). - Optional Dimension Overrides: Set custom pixel
WidthorHeightoverrides if resizing is needed. - Convert to PNG: Click Convert to PNG to execute conversion.
- Download or Copy: Click Download to save your
.pngfile or Copy the Base64 Data URI.
Related Developer Utilities
- WebP to PNG Converter — Convert modern WebP graphics to PNG.
- TIFF to PNG Converter — Convert uncompressed TIFF scans to PNG.
- JPG to PNG Converter — Convert JPG photos to lossless PNG images.
- 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/avif-to-png) for programmatic validation, ISOBMFF dimension parsing, and PNG Data URI formatting.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String | Raw Base64 string or Data URI of the AVIF image. | "data:image/avif;base64,AAAAIGZ0..." |
options.scale |
Number | Multiplier scale factor (1, 2, 3, 4). Default is 1. |
2 |
options.width |
Number | Optional target width in pixels. | 1200 |
options.height |
Number | Optional target height in pixels. | 800 |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/image/avif-to-png \
-H "Content-Type: application/json" \
-d '{
"rawText": "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZgAAAChmetaAAAAAAAAAIWlocGQAAAAAAAAAAAAAAAAAAAAAAAAPaXJvcgAAAAAAAAAAAAAAAgAAAAAAAABTaXBycAAAABNjb2xybmNseAAAAAEABAAHAAAAAmlzcGUAAAAAAAAAAQAAAAEAAAAAYXNzZQAAABhpcG1hAAAAAAAAAAEAAQQEAAAEAA==",
"options": {
"scale": 1
}
}'Python
import requests
url = "https://blueutils.com/api/image/avif-to-png"
payload = {
"rawText": "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZgAAAChmetaAAAAAAAAAIWlocGQAAAAAAAAAAAAAAAAAAAAAAAAPaXJvcgAAAAAAAAAAAAAAAgAAAAAAAABTaXBycAAAABNjb2xybmNseAAAAAEABAAHAAAAAmlzcGUAAAAAAAAAAQAAAAEAAAAAYXNzZQAAABhpcG1hAAAAAAAAAAEAAQQEAAAEAA==",
"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/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZgAAAChmetaAAAAAAAAAIWlocGQAAAAAAAAAAAAAAAAAAAAAAAAPaXJvcgAAAAAAAAAAAAAAAgAAAAAAAABTaXBycAAAABNjb2xybmNseAAAAAEABAAHAAAAAmlzcGUAAAAAAAAAAQAAAAEAAAAAYXNzZQAAABhpcG1hAAAAAAAAAAEAAQQEAAAEAA==",
"options": {
"scale": 1
}
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/image/avif-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 AVIF was parsed successfully. | true |
mimeType |
String | Target output MIME type (image/png). |
"image/png" |
originalFormat |
String | Detected input MIME type (image/avif). |
"image/avif" |
dataUri |
String | Base64 PNG Data URI string. | "data:image/png;base64,..." |
metadata.originalWidth |
Number | Original width in pixels extracted from ispe box. |
800 |
metadata.originalHeight |
Number | Original height in pixels extracted from ispe box. |
600 |
metadata.targetWidth |
Number | Scaled target pixel width. | 800 |
metadata.targetHeight |
Number | Scaled target pixel height. | 600 |
metadata.scale |
Number | Scale factor applied. | 1 |
metadata.majorBrand |
String | Detected ISOBMFF major brand (avif, avis, mif1). |
"avif" |
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/avif",
"dataUri": "data:image/png;base64,AAAAIGZ0...",
"base64": "AAAAIGZ0...",
"metadata": {
"originalWidth": 800,
"originalHeight": 600,
"targetWidth": 800,
"targetHeight": 600,
"scale": 1,
"majorBrand": "avif",
"aspectRatio": 1.3333,
"originalSizeBytes": 18200,
"formattedSize": "17.8 KB"
},
"snippets": {
"html": "<img src=\"data:image/png;base64,...\" width=\"800\" height=\"600\" alt=\"Converted PNG Image\" />",
"css": "background-image: url(\"data:image/png;base64,...\");",
"markdown": ""
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Invalid format: Expected a valid AVIF image (ftyp/avif container or data:image/avif)."
}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 AVIF to PNG?
Automating AVIF conversion via API in build workflows and upload pipelines offers major benefits:
- Broad Platform Compatibility: Transform AVIF assets into PNG containers for legacy browsers, email templates, and automated PDF reporting pipelines.
- Optimized Token Efficiency for AI Agents: Extracts clean image dimensions and brand metadata before sending image data to multimodal vision agents.
- Deterministic Pipeline Integration: Enables automated CI/CD release scripts to generate fallback PNG assets for older client runtimes.
Native Usage
How to convert AVIF to PNG locally using command-line tools:
Windows (CMD / PowerShell)
# PowerShell: Convert AVIF to PNG using ImageMagick
magick "input.avif" "output.png"Linux / Unix (Bash / Shell)
# Bash: Convert AVIF to PNG using avifdec (libavif)
avifdec input.avif output.png
# Or using ImageMagick:
magick input.avif output.pngPython
# Python using Pillow (PIL with pillow-avif-plugin or modern Pillow)
from PIL import Image
image = Image.open('input.avif')
image.save('output.png', 'PNG')
print("Converted input.avif to output.png successfully")Java
// Java using ImageIO (with TwelveMonkeys AVIF plugin)
import java.io.File;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class AvifToPng {
public static void main(String[] args) throws Exception {
BufferedImage inputImage = ImageIO.read(new File("input.avif"));
ImageIO.write(inputImage, "png", new File("output.png"));
System.out.println("Converted input.avif to output.png successfully");
}
}