#EPS Processing

Pixault provides end-to-end processing for EPS (Encapsulated PostScript) files — the vector format used by stock photo services like Shutterstock and Adobe Stock. Stock EPS files often pack multiple designs into a single file that's unusable without Illustrator. Pixault handles rasterization, design splitting, and vector SVG extraction automatically.

#How It Works

EPS processing is asynchronous. When you upload an EPS file, Pixault validates it, stores the original, and queues a background job to rasterize it to PNG. You can then trigger additional operations (splitting, SVG extraction) via the API.

Upload EPS
   ↓
Validate (PostScript header + BoundingBox)
   ↓
Store original, queue background job
   ↓
Rasterize to PNG at 300 DPI (Ghostscript)
   ↓
Create derived assets linked to parent
   ↓
[Optional] Split designs  →  individual PNGs
[Optional] Extract SVG    →  vector SVGs

Each step produces derived assets — new images linked to the parent EPS via the sourceAssetId field. Derived assets have their own image IDs and can be transformed, delivered, and managed like any other image.

#Upload

Upload an EPS file using the standard upload endpoint:

curl -X POST https://img.pixault.io/api/myapp/upload \
  -H "X-Client-Id: px_cl_abc123" \
  -H "X-Client-Secret: pk_secret456" \
  -F "[email protected]"

#Validation

Pixault validates EPS files by checking:

  1. PostScript header — The file must start with %!PS-Adobe-

  2. BoundingBox — A %%BoundingBox: llx lly urx ury DSC comment must be present in the first 4 KB, defining the image dimensions in PostScript points

Files that fail either check are rejected with 400 Bad Request. Maximum file size is 50 MB.

#Response

{
  "imageId": "eps_01JKXYZ",
  "url": "/myapp/eps_01JKXYZ",
  "width": 4000,
  "height": 3000,
  "size": 8234567,
  "isEps": true,
  "processingJobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

The processingJobId lets you track the rasterization job. The isEps flag distinguishes EPS uploads from regular images.

#Background Rasterization

After upload, a background job rasterizes the EPS to PNG at 300 DPI using Ghostscript.

  • Single-page files produce one derived PNG with derivationType: "rasterized"

  • Multi-page files produce one PNG per page with derivationType: "page-1", "page-2", etc.

Page count is detected from the %%Pages: DSC comment in the file header, falling back to a Ghostscript probe if the comment is missing.

The first rasterized PNG is automatically set as the parent EPS thumbnail, so the EPS appears with a preview in your image library.

#Polling for Completion

GET /api/{project}/{imageId}/processing-status

curl https://img.pixault.io/api/myapp/eps_01JKXYZ/processing-status \
  -H "X-Client-Id: px_cl_abc123" \
  -H "X-Client-Secret: pk_secret456"
{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "source": "eps-processing",
  "status": "Running",
  "totalAssets": 4,
  "processedAssets": 2,
  "succeededAssets": 2,
  "failedAssets": 0,
  "startedAt": "2026-03-15T10:30:05Z",
  "completedAt": null
}

Status

Meaning

Pending

Job queued, waiting for worker

Running

Rasterization in progress

Completed

All pages processed successfully

Failed

Processing error (check failedAssets)

#Derived Assets

Every operation on an EPS (rasterization, splitting, SVG extraction) creates derived assets linked to the parent via sourceAssetId.

#Derivation Types

Type

Source Operation

Description

rasterized

Auto (upload)

Single-page PNG at 300 DPI

page-1

Auto (upload)

First page of multi-page EPS

page-2

Auto (upload)

Second page, etc.

split-1

Split

First extracted design region

split-2

Split

Second design region, etc.

svg

SVG extraction

Full-page vector SVG

svg-1

SVG extraction

First individual design SVG

svg-2

SVG extraction

Second design SVG, etc.

#List Derived Assets

GET /api/{project}/{imageId}/derived

curl https://img.pixault.io/api/myapp/eps_01JKXYZ/derived \
  -H "X-Client-Id: px_cl_abc123" \
  -H "X-Client-Secret: pk_secret456"
[
  {
    "imageId": "img_01JKABC",
    "derivationType": "rasterized",
    "contentType": "image/png",
    "width": 4000,
    "height": 3000,
    "sizeBytes": 2456789,
    "uploadedAt": "2026-03-15T10:30:10Z"
  },
  {
    "imageId": "img_01JKDEF",
    "derivationType": "split-1",
    "contentType": "image/png",
    "width": 1200,
    "height": 900,
    "sizeBytes": 345678,
    "uploadedAt": "2026-03-15T10:32:00Z"
  }
]

Derived assets are excluded from the main image listing by default. Pass includeDerived=true to include them.

#Design Splitting

Stock EPS files frequently pack multiple designs into a single page — a grid of icons, a set of illustrations, or variations of a logo. The split operation detects and extracts individual designs automatically.

POST /api/{project}/{imageId}/split

curl -X POST "https://img.pixault.io/api/myapp/eps_01JKXYZ/split" \
  -H "X-Client-Id: px_cl_abc123" \
  -H "X-Client-Secret: pk_secret456"

#How Splitting Works

  1. The rasterized PNG is analyzed pixel by pixel

  2. Each pixel's brightness is calculated — pixels with brightness >= 245 (out of 255) are considered whitespace

  3. Row and column projections count non-whitespace pixels along each axis

  4. Contiguous bands of content separated by gaps of whitespace are identified

  5. Horizontal and vertical bands are intersected to form rectangular design regions

  6. Each region is cropped and saved as a derived asset

The algorithm detects designs arranged in grids, rows, columns, or irregular layouts, as long as they're separated by whitespace gaps.

#Parameters

Parameter

Type

Default

Description

minGapPx

int

50

Minimum whitespace gap (in pixels) between designs

minDesignPx

int

100

Minimum design dimension (filters out noise)

Adjust these if the defaults don't work for your files:

# Tighter spacing between designs
curl -X POST "https://img.pixault.io/api/myapp/eps_01JKXYZ/split?minGapPx=20"
# Only detect larger designs
curl -X POST "https://img.pixault.io/api/myapp/eps_01JKXYZ/split?minDesignPx=200"

#Response 202 Accepted

{
  "jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "statusUrl": "/api/myapp/eps_01JKXYZ/processing-status"
}

Splitting is asynchronous. Poll the status URL to track progress. Each detected design becomes a derived asset with derivationType of "split-1", "split-2", etc.

#SVG Extraction

Extract vector SVGs from an EPS file, preserving paths and shapes rather than rasterizing.

POST /api/{project}/{imageId}/extract-svg

curl -X POST https://img.pixault.io/api/myapp/eps_01JKXYZ/extract-svg \
  -H "X-Client-Id: px_cl_abc123" \
  -H "X-Client-Secret: pk_secret456"

#How Extraction Works

The pipeline converts EPS to SVG in two stages:

  1. EPS to PDF — Ghostscript's pdfwrite device converts PostScript to PDF while preserving vector paths

  2. PDF to SVGpdftocairo extracts paths, shapes, and text into clean SVG markup

The resulting SVG is then sanitized to remove potentially dangerous elements (scripts, external references, event handlers) using an allowlist approach.

If the SVG contains multiple designs, individual design SVGs are also extracted using the same gap-detection algorithm as raster splitting, but operating on vector bounding boxes projected onto a grid.

#Derived Assets

Asset

DerivationType

Description

Full-page SVG

svg

Complete vector conversion

Design 1 SVG

svg-1

First detected design

Design 2 SVG

svg-2

Second detected design

#Response 202 Accepted

{
  "jobId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "statusUrl": "/api/myapp/eps_01JKXYZ/processing-status"
}

#On-Demand Delivery

You can request an EPS file through the standard image delivery URL pattern:

https://img.pixault.io/myapp/eps_01JKXYZ/w_800.webp

When the delivery pipeline encounters an EPS original, it rasterizes on-demand at 300 DPI, applies the requested transforms (resize, blur, watermark, etc.), caches the result, and returns the image. Subsequent requests for the same transform are served from cache.

This means EPS files work with all the same transform parameters as regular images — no special handling required on your end.

#Example Workflow

A typical workflow for processing a stock EPS file:

# 1. Upload the EPS
RESPONSE=$(curl -s -X POST https://img.pixault.io/api/myapp/upload \
  -H "X-Client-Id: px_cl_abc123" \
  -H "X-Client-Secret: pk_secret456" \
  -F "[email protected]")
IMAGE_ID=$(echo $RESPONSE | jq -r '.imageId')
# 2. Wait for rasterization to complete
curl "https://img.pixault.io/api/myapp/$IMAGE_ID/processing-status"
# 3. Split into individual designs
curl -X POST "https://img.pixault.io/api/myapp/$IMAGE_ID/split"
# 4. Extract vector SVGs
curl -X POST "https://img.pixault.io/api/myapp/$IMAGE_ID/extract-svg"
# 5. List all derived assets
curl "https://img.pixault.io/api/myapp/$IMAGE_ID/derived"
# 6. Use individual designs via standard delivery
# https://img.pixault.io/myapp/img_01JKABC/w_400.webp

#API Reference

Method

Route

Description

POST

/api/{project}/upload

Upload EPS file

GET

/api/{project}/{imageId}/processing-status

Check job progress

GET

/api/{project}/{imageId}/derived

List derived assets

POST

/api/{project}/{imageId}/split

Split multi-design file

POST

/api/{project}/{imageId}/extract-svg

Extract vector SVGs