What does the PNG to PSD Converter do?
The PNG to PSD Converter transforms Portable Network Graphics (.png) raster images into Adobe Photoshop Documents (.psd) and Base64 Data URIs (data:image/vnd.adobe.photoshop;base64,...). It parses binary PNG IHDR chunks to extract intrinsic pixel dimensions, bit depth, and alpha transparency channels, constructing clean Photoshop binary files conforming to the 8BPS file format specification with RGB/RGBA planar color channels, resolution scaling presets, custom dimension overrides, and optional background color fills.
Core Concepts
- PNG Raster Format: Portable Network Graphics (PNG) is a bitmapped image format utilizing lossless DEFLATE compression with 8-bit or 16-bit alpha transparency channels.
- Adobe Photoshop Document (PSD): PSD is the standard native raster file format used by Adobe Photoshop, GIMP, Photopea, and digital painting software. It stores image dimensions, color modes (RGB, CMYK, Grayscale), bit depth, and layer structures.
- 8BPS Specification: The binary Photoshop document header starts with the
8BPSmagic bytes followed by version, channel count (3 for RGB, 4 for RGBA), height, width, and planar image channel data. - Resolution Scaling & Retina Multipliers: Scale output image dimensions at 1x, 2x Retina, 3x, or 4x print quality multipliers, or set explicit pixel width and height boundaries.
- Background Matte Composition: Preserve transparent background alpha channels or composite the graphic over solid white, dark navy, or custom hex color fills.
How to use the tool?
- Upload or Paste Input: Drag & drop a
.pngfile into the drop zone or paste a Base64-encoded Data URI string into the text editor. - Configure Resolution Scale & Dimensions: Select a scale preset (1x, 2x, 3x, 4x) or enter explicit width and height values in pixels.
- Select Background Fill: Choose transparent alpha or select a solid background color (white, dark navy, or custom hex code).
- Convert to PSD: Click Convert to PSD to process the image and generate the Photoshop document.
- Download or Copy: Click Download to save the standalone
.psdPhotoshop file, or copy the Base64 Data URI string.
Related Developer Utilities
- PSD to PNG Converter — Extract PNG raster images from Adobe Photoshop PSD files.
- PNG to SVG Converter — Convert PNG raster graphics into scalable SVG vector markup.
- PNG to EPS Converter — Convert PNG images into Encapsulated PostScript vector documents.
- PNG to JPG Converter — Convert PNG images to compressed JPEG files.
- PSD to SVG Converter — Convert Photoshop PSD documents into scalable SVG graphics.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/image/png-to-psd) for programmatic Photoshop document generation.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String | PNG Base64 payload or Data URI string. | "data:image/png;base64,iVBORw0KGgo..." |
options.scale |
Number | Optional resolution scaling multiplier (1 to 10). | 2 |
options.width |
Number | Optional explicit target width in pixels. | 800 |
options.height |
Number | Optional explicit target height in pixels. | 600 |
options.bgColor |
String | Optional background fill color (hex code or 'transparent'). |
"#ffffff" |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/image/png-to-psd \
-H "Content-Type: application/json" \
-d '{ "rawText": "data:image/png;base64,iVBORw0KGgo...", "options": { "scale": 1, "bgColor": "transparent" } }'Python
import requests
url = "https://blueutils.com/api/image/png-to-psd"
payload = {
"rawText": "data:image/png;base64,iVBORw0KGgo...",
"options": {"scale": 2, "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,iVBORw0KGgo...\", \"options\": {\"scale\": 1}}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/image/png-to-psd"))
.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 conversion succeeded. | true |
mimeType |
String | Output MIME type (image/vnd.adobe.photoshop). |
"image/vnd.adobe.photoshop" |
originalFormat |
String | Detected source image MIME type. | "image/png" |
dataUri |
String | Complete PSD Base64 Data URI. | "data:image/vnd.adobe.photoshop;base64,..." |
metadata.originalWidth |
Number | Extracted source image width in pixels. | 100 |
metadata.originalHeight |
Number | Extracted source image height in pixels. | 100 |
metadata.targetWidth |
Number | Computed output width in pixels. | 200 |
metadata.targetHeight |
Number | Computed output height in pixels. | 200 |
metadata.scale |
Number | Applied scaling factor. | 2 |
metadata.channels |
Number | Number of color channels in the PSD document. | 4 |
metadata.hasAlpha |
Boolean | Whether alpha transparency was detected in IHDR. | true |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"mimeType": "image/vnd.adobe.photoshop",
"originalFormat": "image/png",
"dataUri": "data:image/vnd.adobe.photoshop;base64,OEJQUwEAAAAAAA...",
"metadata": {
"originalWidth": 100,
"originalHeight": 100,
"targetWidth": 200,
"targetHeight": 200,
"scale": 2,
"bgColor": "transparent",
"channels": 4,
"colorMode": "RGB (8BPS)",
"bitDepth": 8,
"hasAlpha": true,
"aspectRatio": 1,
"originalSizeBytes": 128,
"psdSizeBytes": 160040,
"formattedSize": "156.3 KB"
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "PNG image payload cannot be empty. Please upload a PNG file or provide a Base64 string."
}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 PSD?
Integrating the PNG to PSD API into design automation pipelines, asset converters, and publishing tools offers practical advantages:
- Automated Design Asset Prep: Programmatically convert PNG screenshots and interface exports into Photoshop PSD files ready for graphic design teams.
- Optimized Token Efficiency for AI Agents: Offload binary PNG parsing, IHDR dimension extraction, and 8BPS Photoshop binary structure generation to a deterministic endpoint.
- Deterministic Accuracy Without Hallucinations: Ensures valid 8BPS Photoshop binary headers and exact planar channel byte alignments without LLM hallucinations.
Native Usage
Convert PNG files into PSD documents locally using native operating system utilities and standard libraries:
Windows (PowerShell)
# Convert PNG into a PSD document using PowerShell and 8BPS binary header construction
$pngBytes = [System.IO.File]::ReadAllBytes("input.png")
$width = [System.BitConverter]::ToUInt32($pngBytes[19..16], 0)
$height = [System.BitConverter]::ToUInt32($pngBytes[23..20], 0)
$header = [byte[]]@(
0x38, 0x42, 0x50, 0x53, # 8BPS signature
0x00, 0x01, # Version 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # 6 reserved bytes
0x00, 0x03 # 3 channels (RGB)
)
$heightBytes = [System.BitConverter]::GetBytes([uint32]$height)
[Array]::Reverse($heightBytes)
$widthBytes = [System.BitConverter]::GetBytes([uint32]$width)
[Array]::Reverse($widthBytes)
$tail = [byte[]]@(0x00, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
$psd = $header + $heightBytes + $widthBytes + $tail
[System.IO.File]::WriteAllBytes("output.psd", $psd)
Write-Output "Generated output.psd successfully"Linux / Unix (Bash)
# Convert PNG to PSD using ImageMagick
convert input.png output.psd
echo "Converted input.png to output.psd successfully"Python
# Standard library Python conversion constructing 8BPS Photoshop binary format
import struct
with open("input.png", "rb") as f:
png_data = f.read()
# Extract PNG dimensions from IHDR (offset 16 and 20)
width = struct.unpack(">I", png_data[16:20])[0]
height = struct.unpack(">I", png_data[20:24])[0]
# Build 8BPS PSD header
# 8BPS, version 1, 6 reserved bytes, 3 channels, height, width, 8-bit depth, RGB mode (3)
header = struct.pack(">4sH6sHIIHH", b"8BPS", 1, b"\x00" * 6, 3, height, width, 8, 3)
empty_sections = struct.pack(">III", 0, 0, 0)
compression = struct.pack(">H", 0)
pixel_data = b"\xff" * (3 * width * height)
with open("output.psd", "wb") as f:
f.write(header + empty_sections + compression + pixel_data)
print(f"Converted input.png ({width}x{height}) to output.psd successfully")Java
// Standard library Java conversion constructing 8BPS Photoshop binary format
import java.io.File;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
public class PngToPsd {
public static void main(String[] args) throws Exception {
byte[] pngBytes = Files.readAllBytes(Paths.get("input.png"));
ByteBuffer bb = ByteBuffer.wrap(pngBytes);
int width = bb.getInt(16);
int height = bb.getInt(20);
ByteBuffer psd = ByteBuffer.allocate(26 + 12 + 2);
psd.put("8BPS".getBytes());
psd.putShort((short) 1);
psd.put(new byte[6]);
psd.putShort((short) 3); // 3 channels
psd.putInt(height);
psd.putInt(width);
psd.putShort((short) 8); // 8-bit depth
psd.putShort((short) 3); // RGB mode
psd.putInt(0); // Color mode section length
psd.putInt(0); // Image resources section length
psd.putInt(0); // Layer and mask section length
psd.putShort((short) 0); // Compression raw
try (FileOutputStream fos = new FileOutputStream(new File("output.psd"))) {
fos.write(psd.array());
}
System.out.println("Converted input.png to output.psd successfully");
}
}