PSD (.psd, .psb)
0
Upvotes
3
Views
0
Downloads
1,413
Words
Description
PSD file format expert analyzing layers, masks, color modes, and metadata to ensure fidelity and cross-tool interoperability.
When to Use
tell me about PSD file format | explain PSD layers and masks preservation | compare PSD and PSB specs | check PSD interoperability with other design tools
Use Cases
Inspect PSD/PSB layer structure for cross-tool work. | Validate color depths and layer preservation requirements. | Assess metadata support (EXIF/IPTC/XMP) in PSDs. | Compare PSD vs PSB for large documents.
SKILL.md Content
---
name: psd
description: "PSD file format expert analyzing layers, masks, color modes, and metadata to ensure fidelity and cross-tool interoperability."
metadata:
tags: "file-format, psd, photoshop, layers-masks, interoperability, metadata, color-depth"
source: "https://skilldb.dev/skills/file-formats-skills/psd"
pack: "file-formats-skills"
category: "Technology & Engineering"
---
# PSD (.psd, .psb)
## When to use this skill
Use when the user says things like:
- "tell me about PSD file format"
- "explain PSD layers and masks preservation"
- "compare PSD and PSB specs"
- "check PSD interoperability with other design tools"
You are a file format specialist with deep knowledge of the PSD file format, its layer architecture, Photoshop feature preservation, and interoperability with other design tools.
## Overview
PSD (Photoshop Document) is the native file format for Adobe Photoshop, the industry-standard raster image editor. The format has evolved alongside Photoshop since version 1.0 (1990) and stores the complete state of a Photoshop project, including layers, masks, channels, paths, smart objects, text, and adjustment layers. PSB (Photoshop Big) was introduced to overcome PSD's file size and dimension limits. PSD has become a de facto interchange format in the design industry, with support in competing tools like GIMP, Affinity Photo, Sketch, and Figma. The format specification is partially documented by Adobe, enabling third-party implementations.
## Technical Specifications
- **File extension(s):** `.psd` (standard), `.psb` (large document format)
- **MIME type:** `image/vnd.adobe.photoshop`, `application/x-photoshop`
- **Compression type:** Individual layers use RLE (PackBits) or ZIP compression. The flattened composite is included as a separate compressed image for compatibility. RAW (uncompressed) is also an option.
- **Color depth:** 1-bit, 8-bit, 16-bit, and 32-bit per channel
- **Max dimensions (PSD):** 30,000 x 30,000 pixels, 2 GB file size limit
- **Max dimensions (PSB):** 300,000 x 300,000 pixels, no practical file size limit (exabyte-scale)
- **Color modes:** RGB, CMYK, Grayscale, Lab, Duotone, Indexed Color, Bitmap, Multichannel
- **Layer types:** Pixel layers, adjustment layers, fill layers, type (text) layers, shape layers, smart objects (embedded or linked), group folders
- **Features preserved:** Blend modes, opacity, layer masks, vector masks, clipping masks, layer effects (drop shadow, bevel, etc.), layer comps, paths, channels (alpha, spot color), Smart Filters, artboards
- **Metadata support:** EXIF, IPTC, XMP, ICC color profiles, annotations
## How to Work With It
### Opening & Viewing
- **Adobe Photoshop:** Full support (the defining application)
- **Affinity Photo:** Very good PSD support including layers, effects, and adjustment layers
- **GIMP:** Opens PSD with layers but may not preserve all Photoshop-specific features (smart objects flatten, some blend modes differ)
- **Figma/Sketch:** Import PSD layers as design elements
- **Photopea:** Free web-based editor with excellent PSD support
- **Quick preview:** macOS Preview, Windows (via Photoshop or third-party codecs), IrfanView
- **Programming:** Python `psd-tools` library, Node.js `ag-psd` or `psd.js`
### Creating & Editing
- **Photoshop workflow:** File > Save As > Photoshop (.psd). Enable "Maximize PSD and PSB File Compatibility" to embed a flattened composite (increases file size but improves compatibility with other apps).
- **PSB for large files:** If dimensions exceed 30,000px or file size exceeds 2 GB, Photoshop automatically prompts to save as PSB.
- **Smart Objects:** Embed linked files (other PSDs, AI files, RAW files) that update non-destructively
- **Layer organization:** Use groups, color labels, and naming conventions for complex documents with dozens or hundreds of layers
### Converting To/From
- **PSD to PNG/JPEG:** Photoshop File > Export > Export As, or `magick input.psd[0] output.png` (the `[0]` selects the flattened composite)
- **Extract layers:** `magick input.psd output_%d.png` (exports each layer as a separate file)
- **PSD to PDF:** Photoshop File > Save As > Photoshop PDF
- **Python:** `from psd_tools import PSDImage; psd = PSDImage.open("file.psd"); psd.composite().save("output.png")`
- **Flatten and export:** `magick input.psd -flatten output.tiff` (merges all visible layers)
## Common Use Cases
- Photo retouching and compositing (primary use case)
- Digital art and illustration
- UI/UX design mockups (legacy; Figma/Sketch now preferred)
- Print design (CMYK support, bleeds, spot colors)
- Web design asset creation
- Photo manipulation and restoration
- Product mockups and templates
- Design system component libraries (legacy workflows)
- Handoff between designers and developers
## Pros & Cons
**Pros:**
- Preserves complete editing state (layers, masks, effects, text, paths)
- Industry standard with near-universal support in professional tools
- Non-destructive workflow with adjustment layers and smart objects
- Supports all professional color modes (CMYK, Lab, Multichannel)
- Up to 32-bit per channel for HDR compositing
- PSB format handles extremely large images
- Partially documented specification enables third-party support
- Smart Objects allow embedded, linked, and nested compositions
**Cons:**
- Proprietary format (Adobe controls the specification)
- Very large file sizes (complex PSDs regularly exceed 1-5 GB)
- Full feature support requires Adobe Photoshop
- Third-party tools often lose some features on open/save
- PSD has 30,000px and 2 GB limits (PSB needed for larger files)
- Not suitable for final delivery (must export to JPEG/PNG/TIFF/PDF)
- Slow to open and save for large documents
- Cannot be viewed in web browsers
## Compatibility
| Platform | Support |
|----------|---------|
| Photoshop | Full (defining application) |
| Affinity Photo | Very good (layers, effects, adjustments) |
| GIMP | Good (layers, basic effects; smart objects flatten) |
| Photopea | Very good (free web-based) |
| Figma | Import (layers as frames, limited editability) |
| Sketch | Import (basic layer structure) |
| Krita | Good (layers, masks, some blend modes) |
| macOS Preview | Flattened view only |
| Web browsers | Not supported |
## Practical Usage
### Extract layers and metadata from PSD files with Python
```python
from psd_tools import PSDImage
# Open and inspect PSD structure
psd = PSDImage.open("design.psd")
print(f"Size: {psd.width}x{psd.height}, Mode: {psd.color_mode}")
print(f"Layers: {len(psd)}")
# Export flattened composite
psd.composite().save("flattened.png")
# Export individual layers
for i, layer in enumerate(psd.descendants()):
if layer.is_visible() and layer.kind == 'pixel':
image = layer.composite()
if image:
image.save(f"layer_{i}_{layer.name}.png")
print(f"Exported: {layer.name} ({layer.width}x{layer.height})")
```
### Batch process PSD files with ImageMagick
```bash
# Extract flattened composite from PSD (the [0] index)
magick "design.psd[0]" -quality 95 design.jpg
# Export each layer as a separate PNG
magick design.psd layers_%d.png
# Batch convert all PSDs in a directory to high-res PNGs
for f in *.psd; do
magick "${f}[0]" -density 300 "${f%.psd}.png"
echo "Converted: $f"
done
# Resize and flatten PSD for web preview
magick "design.psd[0]" -resize 1200x1200 -quality 80 preview.jpg
```
### Automate PSD export with Photoshop scripting
```javascript
// Photoshop ExtendScript — export all layer comps as PNG
var doc = app.activeDocument;
var comps = doc.layerComps;
var opts = new PNGSaveOptions();
opts.compression = 6;
for (var i = 0; i < comps.length; i++) {
comps[i].apply();
var file = new File(doc.path + "/" + comps[i].name + ".png");
doc.saveAs(file, opts, true, Extension.LOWERCASE);
}
// Node.js — parse PSD without Photoshop
// const PSD = require('psd');
// const psd = PSD.fromFile('design.psd');
// psd.parse();
// psd.tree().export().then(result => { /* layer data */ });
```
## Anti-Patterns
**Using PSD as a delivery format for clients or stakeholders.** PSD is an editing format, not a delivery format. Recipients need Photoshop to view it properly, and the file sizes are enormous. Export to PDF for print review, PNG/JPEG for digital preview, or TIFF for archival delivery. Keep the PSD as your working master file.
**Saving without "Maximize PSD and PSB File Compatibility."** Disabling this option removes the flattened composite preview, making the PSD unreadable by Affinity Photo, GIMP, Figma, and other tools that rely on the composite. Always keep this enabled in Preferences > File Handling unless file size reduction is critical and the file will only ever open in Photoshop.
**Flattening layers or rasterizing smart objects to "reduce file size."** Destroying editability to save disk space is almost always a false economy. Once flattened, you cannot recover individual layers, adjustment settings, or smart object sources. Keep the layered master file and create flattened exports separately for distribution.
**Using PSD instead of PSB when approaching size or dimension limits.** PSD has a hard limit of 30,000 x 30,000 pixels and 2 GB file size. Hitting these limits can cause data corruption or silent truncation. If your document has very high resolution or many layers, proactively save as PSB (File > Save As > Large Document Format) before reaching the limits.
**Embedding high-resolution raster images directly into layers instead of using Smart Objects.** Placing a 100 MB TIFF directly as a pixel layer doubles the file size and makes updates painful. Use Smart Objects (File > Place Embedded/Linked) so the source file can be edited non-destructively, replaced, and updated across multiple compositions.
## Related Formats
- **TIFF (layered):** Photoshop can save layers in TIFF, but with less feature preservation than PSD
- **PSB:** Large Document Format; PSD without size/dimension limits
- **XCF:** GIMP's native format (similar concept, different ecosystem)
- **AI:** Adobe Illustrator native format (vector-focused counterpart)
- **INDD:** InDesign native format (page layout counterpart)
- **Affinity Photo (.afphoto):** Affinity's native format with similar layer capabilities
- **Procreate (.procreate):** iPad drawing app's native format
- **Figma (.fig):** Modern UI design format replacing PSD in many design workflows