Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class PsdReader

  1. Object
  2. PsdReader

Reads Photoshop PSD and PSB files into an ArtDocument.

Each pixel layer becomes a RasterNode, each group a GroupNode (pass through or isolated), each adjustment layer an AdjustmentNode, and each solid or gradient fill layer a ShapeNode over the canvas. Blend modes, opacity, fill opacity, visibility, clipping masks, layer masks, vector masks and the layer style effects (shadows, glows, bevel, satin, overlays and stroke) are kept and rendered. Text and smart object layers are read as the pixels Photoshop stored for them.

RGB, grayscale, CMYK, Lab, indexed, duotone and bitmap images at 1, 8, 16 and 32 bits per channel are read. Without layers, the merged image is the one layer.

Fields

public static final int MAX_DIMENSION = 300000The largest width or height read: Photoshop’s own PSB limit.
public static final int MAX_LAYERS = 10000The most layers read.

Methods

public static ArtDocument read(InputStream in) throws IOExceptionReads a PSD or PSB file.
public static ArtDocument read(byte[] data) throws IOExceptionReads a PSD or PSB file from bytes.

Inherited methods

Field details

MAX_DIMENSION

public static final int MAX_DIMENSION = 300000
The largest width or height read: Photoshop’s own PSB limit.

MAX_LAYERS

public static final int MAX_LAYERS = 10000
The most layers read.

Method details

read

public static ArtDocument read(InputStream in) throws IOException
Reads a PSD or PSB file.

Parameters

in InputStream
the file; read to its end, not closed

read

public static ArtDocument read(byte[] data) throws IOException
Reads a PSD or PSB file from bytes.

Parameters

data byte[]
the file