# PSD Reader — layers, extract & editable templates (API) (`synthetic.ia/psd-reader`) Actor

Read Adobe Photoshop .psd/.psb files without Photoshop: full layer tree, text, extract layers to PNG, flatten the composite, and turn a PSD into an editable template (pick which layers are editable) to auto-generate variations. Clean HTTP API + MCP, no key. Pay per operation.

- **URL**: https://apify.com/synthetic.ia/psd-reader.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 psd operations

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PSD Reader — layers, extract & editable templates (API)

Read Adobe **Photoshop `.psd`/`.psb`** files without Photoshop, behind a clean HTTP API (and MCP tool). Get the full **layer tree**, pull **text** and colours, **extract** any layer as a PNG, **flatten** the composite — and turn a PSD into an **editable template** you can fill programmatically to auto-generate variations (think logo-vs-logo match banners, localized creatives, batch product cards). Powered by `ag-psd`. **No Photoshop, no key.** Pay per operation.

- 🗂️ **Info** — the whole layer tree: names, types (text / pixel / group / smart object / shape / adjustment), bounds, opacity, visibility, blend mode, and text content + font/size/colour.
- 🧩 **Template** — every layer becomes a field; you choose which are **editable** (text, image, colour). Mark them **in Photoshop** by naming a layer `edit_title`, or pass an `editable` list, or let the auto heuristic decide. The base for a dynamic-creative pipeline.
- 🖼️ **Extract** — render chosen layers (or all pixel layers) to PNG/JPEG/WebP, returned as URLs with their positions.
- 🏉 **Render** — flatten the PSD's composite to a PNG/JPEG/WebP (optionally resized).
- 💵 Pay per operation · no key.

### The use case it was built for

Design teams keep the same PSD template and swap a few layers per output — two team crests and a score, a product photo and a price, a translated headline. Doing that at scale means reading the PSD structure, knowing which layers are the "slots", and rendering variations. This Actor is that engine as an API: **Template** turns a PSD into a typed list of fields (with the editable ones flagged), and **Extract/Render** produce the images. Wire it into an automation or an agent (over MCP) and generate hundreds of on-brand creatives from one PSD.

### Marking editable layers — three ways

1. **In the PSD (recommended):** name the layers you want to expose `edit_headline`, `edit_logo`, `edit_bg`… Any layer starting with `edit_` becomes an editable field, and its **key** is the name without the prefix. Zero config at call time.
2. **At call time:** pass `editable: ["Headline", "Logo"]` (layer names or ids).
3. **Auto:** leave both empty and text layers, smart objects and solid-colour layers are marked editable by default.

### Sample output (`template`)

```json
{
  "ok": true, "canvas": { "width": 1080, "height": 1080 },
  "editableBy": "naming convention \"edit_…\"", "fieldCount": 12, "editableCount": 3,
  "fields": [
    { "id": "2.0", "name": "edit_headline", "key": "headline", "kind": "text",
      "editable": true, "rect": { "x": 80, "y": 120, "width": 920, "height": 90 },
      "text": { "content": "GAME DAY", "font": "Poppins-Bold", "size": 72, "color": "#ffffff" } },
    { "id": "1", "name": "edit_home_logo", "key": "home_logo", "kind": "image", "editable": true,
      "rect": { "x": 120, "y": 300, "width": 300, "height": 300 } }
  ]
}
```

### How to use

- **HTTP API (Standby):** `POST /info`, `/template`, `/extract`, `/render`. `GET /` returns help.
- **Normal run:** pass `{ operation, psd, ... }`; results land in the dataset + key-value store.
- **MCP tool:** expose it to your agent via Apify's MCP server.

### Input

- **psd** — the file as an http(s) URL or base64.
- **operation** — `info` · `template` · `extract` · `render`.
- **editable / editablePrefix / includeGroups** — (template) pick editable layers, the naming prefix (default `edit_`), and whether to emit group fields.
- **layers** — (extract) which layers to render (names/ids; empty = all pixel layers).
- **format / width / quality** — (extract/render) `png`/`jpeg`/`webp`, resize, compression.

### Pricing

**Per operation** from **$0.02** (down to $0.008 on higher tiers). One `info`, `template`, `extract` or `render` call = one operation.

### Related Actors

- **[Image Converter & Optimizer](https://apify.com/synthetic.ia/image-converter)** — convert/resize/compress the images you extract or render.

### FAQ

**Does it need Photoshop?** No — it parses the PSD binary directly.

**Which layer data do I get?** Names, types, exact positions/sizes, opacity, blend mode, visibility, text content + font/size/colour, and solid-fill colours. Extract/Render give you the actual pixels.

**Can it flatten any PSD?** Render uses the embedded composite preview. PSDs saved without "Maximize Compatibility" have none — use Extract per layer instead.

### Notes & limits

Up to 80 MB per PSD; Extract renders up to 60 layers per call. Very exotic layer effects may not round-trip perfectly. This reads PSDs — it does not (yet) write edited PSDs back.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/psd-reader/changelog.md

# Actor input Schema

## `operation` (type: `string`):

info = layer tree · template = editable template · extract = layers → images · render = flatten composite.

## `psd` (type: `string`):

The .psd/.psb file — an http(s) URL or a base64 string.

## `editable` (type: `array`):

For operation=template: layer names or ids to mark editable. Empty = use the naming convention (see prefix) or, if none, an auto heuristic.

## `editablePrefix` (type: `string`):

Layers whose name starts with this become editable automatically — mark them in Photoshop (e.g. name a layer "edit\_title"). The field key is the name without the prefix. Set empty to disable.

## `includeGroups` (type: `boolean`):

For template: also emit a field for group/folder layers.

## `layers` (type: `array`):

For operation=extract: layer names or ids to render. Empty = every pixel layer (up to 60).

## `format` (type: `string`):

Output format for extract/render.

## `width` (type: `integer`):

For render: resize the flattened image to at most this width.

## `quality` (type: `integer`):

Compression quality for JPEG/WebP output (1-100).

## Actor input object example

```json
{
  "operation": "info",
  "psd": "https://raw.githubusercontent.com/Agamnentzar/ag-psd/master/test/read-write/layers/src.psd",
  "editablePrefix": "edit_",
  "includeGroups": false,
  "format": "png",
  "quality": 90
}
```

# Actor output Schema

## `result` (type: `string`):

The operation result JSON (layers / template / image URLs).

## `runs` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/psd-reader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/psd-reader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call synthetic.ia/psd-reader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,synthetic.ia/psd-reader"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cMRdXjkUF3aWcXHaA/builds/Iu6r47uZxoHEpPe5T/openapi.json
