What does the PNG to TIFF Converter do?
The PNG to TIFF Converter converts Portable Network Graphics (.png) raster images into uncompressed Tagged Image File Format (.tiff / .tif) files. TIFF is the industry standard for desktop publishing, digital printing, scientific imaging, and long-term document archiving due to its support for high bit depths, uncompressed raster arrays, and standardized Image File Directory (IFD) metadata structures.
This utility validates PNG binary headers, parses intrinsic dimensions and alpha channel metadata from IHDR chunks, and compiles compliant Little-Endian (Intel) TIFF 6.0 binary containers. It supports 24-bit RGB and 32-bit RGBA formats, resolution scaling multipliers (1x to 4x), custom pixel width and height boundaries, solid background color fills, and instant client-side file downloads.
Core Concepts
Understanding the Tagged Image File Format (TIFF 6.0) binary specification:
- TIFF Header (8 Bytes): Starts with endianness bytes (
0x49 0x49for Intel Little-Endian'II'or0x4D 0x4Dfor Motorola Big-Endian'MM'), followed by the TIFF magic number (42in UInt16) and a 4-byte offset pointing to the first Image File Directory (IFD0). - Image File Directory (IFD): A directory table consisting of a 2-byte tag count, followed by 12-byte directory entries (
[Tag (2B)] + [Type (2B)] + [Count (4B)] + [Value/Offset (4B)]), terminated by a 4-byte pointer to the next IFD (0if none). - Standard Baseline IFD Tags:
Tag 256 (ImageWidth): Image horizontal width in pixels.Tag 257 (ImageLength): Image vertical height in pixels.Tag 258 (BitsPerSample): Channel bit depths (8, 8, 8for RGB or8, 8, 8, 8for RGBA).Tag 259 (Compression): Compression scheme (1= Uncompressed).Tag 262 (PhotometricInterpretation): Color model (2= RGB).Tag 273 (StripOffsets): Byte offset pointing to raw image raster scanlines.Tag 277 (SamplesPerPixel): Number of color channels (3for RGB,4for RGBA).Tag 282 & 283 (XResolution & YResolution): Resolution rational values (72 DPI).
How to use the tool?
- Upload or Paste PNG: Drop a
.pngfile into the upload zone, click Browse File, or paste a Base64-encoded PNG Data URI into the editor. Click Load Sample to inspect a sample conversion. - Configure Resolution Scale: Choose from preset multipliers (
1x,2xRetina HD,3xUltra,4xPrint) or enter custom width and height dimensions in pixels. - Choose Background Fill: Select Solid White, Solid Black, Dark Navy, or specify a Custom Color with hex code input.
- Convert & Download: Click Convert to TIFF. The tool generates a live preview, calculates the resulting byte size, and provides a direct Download button for the
.tifffile alongside Base64 Data URIs for code embedding.
Related Developer Utilities
Complementary image conversion tools on blueutils.com:
- TIFF to PNG Converter: Convert TIFF images into lightweight lossless PNG graphics.
- TIFF to JPG Converter: Convert uncompressed TIFF files into compressed JPEG images.
- TIFF to WebP Converter: Convert TIFF graphics into web-optimized WebP assets.
- TIFF to SVG Converter: Vectorize TIFF images into scalable SVG code.
- PNG to WebP Converter: Convert PNG images into modern web-optimized WebP graphics.
- PNG to BMP Converter: Convert PNG graphics to uncompressed Windows bitmaps.
- PNG to JPG Converter: Convert PNG graphics to standard JPEG images.
- PNG to ICO Converter: Package PNG icons into Windows favicons.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/image/png-to-tiff) for programmatic TIFF image 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.bgColor |
String | Optional. Solid background fill in hex format. Defaults to "#ffffff". |
"#ffffff" |
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-tiff \
-H "Content-Type: application/json" \
-d '{
"rawText": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC",
"options": {
"scale": 1,
"bgColor": "#ffffff"
}
}'Python
import requests
url = "https://blueutils.com/api/image/png-to-tiff"
payload = {
"rawText": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNk+M9Qz0AEYBxVSF+FAAhKDveksOjuAAAAAElFTkSuQmCC",
"options": {
"scale": 1,
"bgColor": "#ffffff"
}
}
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, \"bgColor\": \"#ffffff\"}}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/image/png-to-tiff"))
.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/tiff"). |
"image/tiff" |
originalFormat |
String | MIME type of source image ("image/png"). |
"image/png" |
dataUri |
String | Complete TIFF Base64 Data URI. | "data:image/tiff;base64,SUkq..." |
base64 |
String | Pure Base64-encoded TIFF binary buffer string. | "SUkqAAgA..." |
metadata |
Object | Dimensions, aspect ratio, endianness, compression, byte sizes, and IFD properties. | { "originalWidth": 10, "targetWidth": 10, ... } |
snippets |
Object | HTML, CSS, and Markdown embed code snippets. | { "html": "<img src=\"data:image/tiff...\" />" } |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"mimeType": "image/tiff",
"originalFormat": "image/png",
"dataUri": "data:image/tiff;base64,SUkqAAgAAAALAA4ABAAAAAEAAAAKAAAADwAEAAAAAQAAAAoAA...",
"base64": "SUkqAAgAAAALAA4ABAAAAAEAAAAKAAAADwAEAAAAAQAAAAoAA...",
"metadata": {
"originalWidth": 10,
"originalHeight": 10,
"targetWidth": 10,
"targetHeight": 10,
"scale": 1,
"bgColor": "#ffffff",
"endianness": "Little Endian (Intel)",
"compression": "Uncompressed",
"samplesPerPixel": 4,
"bitsPerSample": 8,
"bitDepth": "32-bit (RGBA)",
"colorType": "RGBA Truecolor with Alpha",
"hasAlpha": true,
"formatType": "Tagged Image File Format (TIFF / TIF)",
"aspectRatio": 1,
"originalSizeBytes": 70,
"tiffSizeBytes": 570,
"formattedSize": "570 B"
},
"snippets": {
"html": "<img src=\"data:image/tiff;base64,...\" width=\"10\" height=\"10\" alt=\"Converted TIFF Graphic\" />",
"css": "background-image: url(\"data:image/tiff;base64,...\");",
"markdown": ""
}
}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 TIFF?
Integrating the PNG to TIFF API into printing prepress workflows, document archival systems, and batch processors provides several key advantages:
- Rapid Script Validation: Enables automated build and prepress pipelines to generate uncompressed TIFF fixtures without compiling heavy native C image toolchains.
- Optimized Token Efficiency for AI Agents: LLMs struggle with endian-swapped IFD directory tables, tag value offsets, and rational pointers. Delegating TIFF encoding to a deterministic API saves tokens and eliminates errors.
- Deterministic Accuracy Without Hallucinations: TIFF specifications require strict directory entry structures and byte offset tracking. The API guarantees 100% specification compliance.
Native Usage
How to convert PNG images to TIFF format locally using native operating system utilities and standard libraries:
Windows (PowerShell)
On Windows, PowerShell can convert images to TIFF natively using .NET System.Drawing:
Add-Type -AssemblyName System.Drawing
$sourcePng = "input.png"
$targetTiff = "output.tiff"
$bitmap = [System.Drawing.Bitmap]::FromFile((Resolve-Path $sourcePng))
$bitmap.Save($targetTiff, [System.Drawing.Imaging.ImageFormat]::Tiff)
$bitmap.Dispose()
Write-Host "Converted $sourcePng to $targetTiff successfully."Linux / Unix (Bash)
On Linux/macOS systems, use ImageMagick or standard Netpbm utilities:
# ImageMagick CLI conversion
magick input.png -compress none output.tiff
# Or using Netpbm utilities
pngtopnm input.png | pnmtotiff -none > output.tiffPython
Convert PNG to uncompressed TIFF using the Python standard library:
import struct
def png_to_tiff(width: int, height: int, output_path: str):
"""Creates an uncompressed Little-Endian TIFF 6.0 file using Python standard library."""
channels = 3
pixel_data = bytes([255, 255, 255] * (width * height))
num_tags = 11
ifd_offset = 8
ifd_size = 2 + (num_tags * 12) + 4
extra_offset = ifd_offset + ifd_size
bps_offset = extra_offset
xres_offset = bps_offset + 6
yres_offset = xres_offset + 8
strip_offset = yres_offset + 8
# 1. Header (8B)
header = struct.pack("<2sHI", b"II", 42, ifd_offset)
# 2. IFD entries
tags = [
(256, 4, 1, width), # ImageWidth
(257, 4, 1, height), # ImageLength
(258, 3, channels, bps_offset), # BitsPerSample
(259, 3, 1, 1), # Compression (1=Uncompressed)
(262, 3, 1, 2), # PhotometricInterpretation (2=RGB)
(273, 4, 1, strip_offset), # StripOffsets
(277, 3, 1, channels), # SamplesPerPixel
(278, 4, 1, height), # RowsPerStrip
(279, 4, 1, len(pixel_data)), # StripByteCounts
(282, 5, 1, xres_offset), # XResolution
(283, 5, 1, yres_offset), # YResolution
]
ifd = bytearray(struct.pack("<H", num_tags))
for tag, t, c, val in tags:
ifd += struct.pack("<HHI", tag, t, c)
if t == 3 and c == 1:
ifd += struct.pack("<HH", val, 0)
else:
ifd += struct.pack("<I", val)
ifd += struct.pack("<I", 0)
# 3. Extra Data
extra = struct.pack("<HHH", 8, 8, 8) + struct.pack("<II", 72, 1) + struct.pack("<II", 72, 1)
with open(output_path, "wb") as f:
f.write(header + ifd + extra + pixel_data)
print(f"Created {output_path}")
# Example usage
png_to_tiff(100, 100, "output.tiff")Java
Convert PNG to TIFF using Java standard ImageIO library:
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
public class PngToTiffConverter {
public static void main(String[] args) throws Exception {
File inputFile = new File("input.png");
File outputFile = new File("output.tiff");
BufferedImage image = ImageIO.read(inputFile);
ImageIO.write(image, "tiff", outputFile);
System.out.println("Converted to " + outputFile.getName() + " successfully.");
}
}