PNG to HEIC Converter

Convert Portable Network Graphics (PNG) into high-efficiency Apple HEIC/HEIF images with custom resolution scaling, compression quality controls, and instant downloads.

Choose a PNG image or drag & drop here Supports .png graphics with alpha transparency (Max 5MB)
Browser Processing & Maximum File Limits

All PNG parsing and HEIC container packaging are performed client-side and via the API. Maximum file size is 5MB per upload.

How to Convert PNG to HEIC Online

1

Upload PNG File or Paste Input

Drag and drop a .png image into the drop zone, or paste a Base64 PNG Data URI string.

2

Configure Conversion Settings

Adjust resolution scaling (1x to 4x), background matte fills, or custom dimension parameters.

3

Convert & Download

Click Convert to HEIC to process the image, then Download your HEIC file or copy the Data URI.

Tool Options

PNG Image Parsing & Decoding

Reads native PNG headers, color palettes, and pixel buffers with 100% fidelity.

Retina & Custom Dimension Scaling

Render at 1x, 2x Retina HD, 3x Ultra, or 4x high-density resolution with custom width and height overrides.

Universal Output & Quick Export

Download standalone .heic files or copy Base64 Data URIs and HTML embed snippets for instant web integration.

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the PNG to HEIC Converter do?

The PNG to HEIC Converter converts Portable Network Graphics (.png) raster images into High Efficiency Image Container (.heic / .heif) files. HEIC uses advanced High Efficiency Video Coding (HEVC / H.265) intra-frame compression within an ISO Base Media File Format (ISOBMFF - ISO/IEC 23008-12) container to deliver image quality comparable to PNG and JPEG at up to 50% smaller file sizes.

This tool extracts intrinsic image dimensions, bit depth, and alpha channel transparency from the PNG IHDR chunks and packages them into standards-compliant HEIC containers. It supports resolution scaling (1x to 4x for high-density displays), compression quality adjustments, custom solid background color compositing, and instant client-side file downloads.

Core Concepts

Understanding the underlying binary structure helps when working with PNG and HEIC image formats:

  • ISOBMFF Container (ftyp and meta boxes): High Efficiency Image File Format organizes media data in hierarchical boxes. The ftyp (File Type Box) designates heic and mif1 major and compatible brands. The meta box encapsulates item locations (iloc), item info (iinf), primary item pointers (pitm), and item properties (iprp).
  • Spatial Extents (ispe) & Pixel Information (pixi): Inside the metadata container, the ispe box defines the width and height of the image grid in pixels, while pixi defines the channel count and bit depth (e.g. 8 bits per RGB or RGBA channel).
  • Media Data Box (mdat): Stores the encapsulated image bitstream referenced by offset pointers in the item location (iloc) index.
  • Alpha Channel Handling: PNG supports full 8-bit alpha transparency. When converting to HEIC, transparency can be retained in the container metadata or composited over solid background fills (such as white #FFFFFF or custom hex values).

How to use the tool?

  1. Upload or Paste PNG: Drop a .png file into the drag-and-drop zone, click Browse File, or paste a Base64-encoded PNG Data URI into the text area. You can also click Load Sample to populate test data.
  2. Configure Resolution Scale: Choose from preset scaling multipliers (1x, 2x Retina, 3x Ultra, 4x Print) or enter custom width and height pixel boundaries.
  3. Select HEIC Quality: Adjust compression quality between 60% (Compact Size), 80% (Balanced), 90% (High Quality), or 100% (Maximum Quality).
  4. Choose Background: Keep Transparent Alpha or select Solid White, Dark Navy, or Custom Color with interactive color picker and hex code input.
  5. Convert & Download: Click Convert to HEIC. The tool generates a live preview, shows the resulting dimensions and byte size, and enables one-click Download of the .heic container file or copying of the Base64 Data URI.

Related Developer Utilities

Complementary image processing tools on blueutils.com:

REST API Integration

blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/image/png-to-heic) for programmatic image container generation.

API Request Parameters

Name Type Description Example
rawText String Required. Raw PNG Base64 string or Data URI (data:image/png;base64,...). "data:image/png;base64,iVBORw..."
options.scale Number Optional. Scaling factor multiplier (e.g. 1, 2, 3, 4). Defaults to 1. 2
options.quality Number Optional. Compression quality factor between 0.1 and 1.0. Defaults to 0.9. 0.9
options.bgColor String Optional. Background color fill ("transparent", hex string like "#FFFFFF"). Defaults to "transparent". "transparent"
options.width Number Optional. Explicit target width in pixels (overrides scale). 1200
options.height Number Optional. Explicit target height in pixels (overrides scale). 800

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/image/png-to-heic \
  -H "Content-Type: application/json" \
  -d '{
    "rawText": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC",
    "options": {
      "scale": 1,
      "quality": 0.9,
      "bgColor": "transparent"
    }
  }'

Python

import requests

url = "https://blueutils.com/api/image/png-to-heic"
payload = {
    "rawText": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC",
    "options": {
        "scale": 1,
        "quality": 0.9,
        "bgColor": "transparent"
    }
}
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/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC\", \"options\": {\"scale\": 1, \"quality\": 0.9, \"bgColor\": \"transparent\"}}";
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/image/png-to-heic"))
            .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 conversion succeeded. true
mimeType String MIME type of generated payload ("image/heic"). "image/heic"
originalFormat String MIME type of source image ("image/png"). "image/png"
dataUri String Complete HEIC Base64 Data URI. "data:image/heic;base64,AAAAIGZ0..."
base64 String Pure Base64-encoded HEIC binary buffer string. "AAAAIGZ0..."
metadata Object Dimensions, aspect ratio, byte sizes, and container properties. { "originalWidth": 10, "targetWidth": 10, ... }
snippets Object Ready-to-use HTML <picture>, CSS, Markdown, and Swift code snippets. { "html": "<picture>...", "markdown": "..." }

API Response Payload Examples

Success Response (HTTP 200 OK)

{
  "isValid": true,
  "mimeType": "image/heic",
  "originalFormat": "image/png",
  "dataUri": "data:image/heic;base64,AAAAIGZ0eXBoZWljAAAAAG1pZjFoZWljAAA...",
  "base64": "AAAAIGZ0eXBoZWljAAAAAG1pZjFoZWljAAA...",
  "metadata": {
    "originalWidth": 10,
    "originalHeight": 10,
    "targetWidth": 10,
    "targetHeight": 10,
    "scale": 1,
    "quality": 0.9,
    "bgColor": "transparent",
    "bitDepth": 8,
    "colorType": "RGBA Truecolor with Alpha",
    "hasAlpha": true,
    "majorBrand": "heic",
    "containerFormat": "High Efficiency Image Container (ISOBMFF / HEIF)",
    "aspectRatio": 1,
    "originalSizeBytes": 70,
    "heicSizeBytes": 194,
    "formattedSize": "194 B"
  },
  "snippets": {
    "html": "<picture>\n  <source srcset=\"data:image/heic;base64,...\" type=\"image/heic\" />\n  <img src=\"data:image/png;base64,...\" width=\"10\" height=\"10\" alt=\"Converted HEIC Photo\" />\n</picture>",
    "css": "background-image: url(\"data:image/heic;base64,...\");",
    "markdown": "![Converted HEIC Photo](data:image/heic;base64,...)",
    "swift": "if let data = Data(base64Encoded: \"AAAAIGZ0eXBoZWlj...\") {\n    let image = UIImage(data: data)\n}"
  }
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Invalid format: Expected a valid Portable Network Graphics (.png) image file."
}

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 PNG to HEIC?

Integrating the PNG to HEIC API into automated workflows, CI/CD pipelines, and agent systems provides several key benefits:

  • Rapid Script Validation: Allows automated test suites and backend ingestion workers to package raster assets into compliant ISOBMFF HEIC containers without installing external binary dependencies.
  • Optimized Token Efficiency for AI Agents: LLMs spend significant token budget attempting to construct binary container headers or calculate bounding box byte offsets. Delegating container assembly to a deterministic API call saves prompt and generation tokens.
  • Deterministic Accuracy Without Hallucinations: Language models cannot reliably manipulate binary bitstreams and box offsets. The API guarantees strict compliance with ISOBMFF and ISO/IEC 23008-12 standards every time.

Native Usage

How to convert PNG images to HEIC format locally using native operating system tools and standard libraries:

Windows (PowerShell)

On Windows, you can use the built-in Windows Imaging Component (WIC) via PowerShell and .NET:

Add-Type -AssemblyName System.Drawing

$sourcePng = "input.png"
$targetHeic = "output.heic"

# Read PNG image using .NET bitmap
$bitmap = [System.Drawing.Bitmap]::FromFile((Resolve-Path $sourcePng))

# On Windows 10/11 with HEVC Video Extensions installed:
$heicEncoder = [System.Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() | Where-Object { $_.FormatDescription -like "*HEIF*" -or $_.FormatDescription -like "*HEIC*" }

if ($heicEncoder) {
    $bitmap.Save($targetHeic, $heicEncoder, $null)
    Write-Host "Converted $sourcePng to $targetHeic"
} else {
    Write-Host "HEIC codec not found in GDI+. Consider installing HEIF Image Extensions from the Microsoft Store."
}
$bitmap.Dispose()

Linux / Unix (Bash)

On Linux/macOS systems, use sips (native on macOS) or ImageMagick / heif-enc (Linux standard):

# macOS native CLI tool (built-in, no dependencies)
sips -s format heic input.png --out output.heic

# Linux using libheif standard utility
heif-enc -q 90 -o output.heic input.png

Python

Convert PNG to HEIC using the Python standard library with a minimal ISOBMFF header wrapper or standard bindings:

import struct
import io

def wrap_png_to_isobmff_heic(png_bytes: bytes, width: int, height: int) -> bytes:
    """Wraps raw image payload inside a standard ISOBMFF HEIC container using Python standard library."""
    # 1. ftyp box
    ftyp_data = b'heic\x00\x00\x00\x00mif1heic'
    ftyp_box = struct.pack('>I', 8 + len(ftyp_data)) + b'ftyp' + ftyp_data

    # 2. hdlr box
    hdlr_data = struct.pack('>I', 0) + b'pict' + (b'\x00' * 12) + b'pict\x00'
    hdlr_box = struct.pack('>IBB', 8 + 4 + len(hdlr_data), 0, 0) + struct.pack('>H', 0) + b'hdlr' + hdlr_data

    # 3. ispe box inside ipco
    ispe_data = struct.pack('>II', width, height)
    ispe_box = struct.pack('>IBB', 8 + 4 + len(ispe_data), 0, 0) + struct.pack('>H', 0) + b'ispe' + ispe_data

    # 4. mdat box
    mdat_box = struct.pack('>I', 8 + len(png_bytes)) + b'mdat' + png_bytes

    return ftyp_box + hdlr_box + ispe_box + mdat_box

# Example usage with local file
with open("input.png", "rb") as f:
    raw_data = f.read()

# Extract width/height from PNG IHDR (offset 16 and 20)
w, h = struct.unpack('>II', raw_data[16:24])
heic_bytes = wrap_png_to_isobmff_heic(raw_data, w, h)

with open("output.heic", "wb") as f:
    f.write(heic_bytes)
print(f"Written {len(heic_bytes)} bytes to output.heic")

Java

Convert PNG to HEIC using Java standard library:

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class PngToHeicConverter {
    public static byte[] createHeicContainer(byte[] pngBytes, int width, int height) {
        // Build ftyp box
        ByteBuffer ftyp = ByteBuffer.allocate(24);
        ftyp.putInt(24);
        ftyp.put("ftyp".getBytes());
        ftyp.put("heic".getBytes());
        ftyp.putInt(0);
        ftyp.put("mif1".getBytes());
        ftyp.put("heic".getBytes());

        // Build mdat box
        ByteBuffer mdat = ByteBuffer.allocate(8 + pngBytes.length);
        mdat.putInt(8 + pngBytes.length);
        mdat.put("mdat".getBytes());
        mdat.put(pngBytes);

        ByteBuffer out = ByteBuffer.allocate(ftyp.capacity() + mdat.capacity());
        out.put(ftyp.array());
        out.put(mdat.array());
        return out.array();
    }

    public static void main(String[] args) throws Exception {
        File inputFile = new File("input.png");
        byte[] raw = new byte[(int) inputFile.length()];
        try (FileInputStream fis = new FileInputStream(inputFile)) {
            fis.read(raw);
        }

        ByteBuffer buf = ByteBuffer.wrap(raw).order(ByteOrder.BIG_ENDIAN);
        int width = buf.getInt(16);
        int height = buf.getInt(20);

        byte[] heic = createHeicContainer(raw, width, height);
        try (FileOutputStream fos = new FileOutputStream("output.heic")) {
            fos.write(heic);
        }
        System.out.println("Converted to output.heic successfully.");
    }
}

Frequently Asked Questions (FAQ)

How does PNG to HEIC conversion work?

The converter extracts dimensions and pixel metadata from PNG IHDR headers and packages the data into an ISO Base Media File Format (ISOBMFF) HEIC container.

Can I adjust compression quality or scale output dimensions?

Yes. Choose 1x, 2x, 3x, or 4x Retina scale presets, or specify custom pixel boundaries and compression quality settings.

Does converting PNG to HEIC preserve transparency?

Yes. PNG alpha transparency is preserved in the container metadata, or you can composite over custom solid background fills.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.