Work with Photoshop (PSD) files

Automate image template processing

  • Load image, text, shapes, Smart Object, group layers and preview from PSD files
  • Read text properties (position, font, paragraph)
  • Edit fields in a PSD template through API or HTML5-based image editor
  • Export results as JPEG, TIFF or even vector PDF/EPS
View Demo Download Trial

Load image, text and group layers from PSD

Unlike other popular file formats, Photoshop (PSD) files consist of multiple layers. With Graphics Mill you can enumerate each layer and read its data:

  • image layer - a bitmap;
  • text layer - a string and text settings;
  • group layer - all children;
  • shape layer - a pen and brush settings;
  • Smart Object layer - an embeded image and its transformation (pseudo-3D surface warping).

Besides data, each layer has its own properties such as name, visibility/editability flags, position, dimensions, opacity, among others.

If you just want to see what the PSD file looks like, there's no need to merge all the layers together. Instead, you can just read a preview layer.

This way Graphics Mill allows the use of PSD files to create W2P or VDP software and automate image template manipulations.

Read important text layer properties

To render a text string you have to take into account font and paragraph settings, color, layer position and boundaries. As PSD is a proprietary file format, extracting all these properties is a challenge, however after years of work, we can do it.

Graphics Mill can read the following text layer settings (in addition to the text string):

  • Font name, size, style, caps
  • Orientation (horizontal or vertical)
  • Paragraph left/right/first line intent, justification, spacing between paragraphs
  • Color
  • Position
  • Text box boundaries (important for multiline text)

Personalize template

The workflow of the template processing may look like this:

  • Load PSD template with Graphics Mill
  • Replace text and image data of the layers with particular names
  • Export the result as a print-ready image

How you would insert a user's data into a template? Graphics Mill allows this in two ways:

Through the image editor

Your users can modify a template right through the browser. Graphics Milll includes an HTML5-based multi-layer image editor which can accept PSD templates.

Through an API

Grab variable data from your database and replace layers of text strings with a specific name. For example, you may generate a separate result file for each database entry. No need to analyze PSD file structrure and apply all effects, transformations, positioning yourself, just use PsdProcessor to do it in few lines of code.

Business card editor
var psdProcessor = new PsdProcessor();

psdProcessor.StringCallback = (processor, textFrame) =>
{
    return GetTextFromDB(textFrame.Name);
};

psdProcessor.Render("Template.psd", "Result.pdf");

Render pseudo-3D mockup preview

Build mockup using Smart Object in Photoshop and render realistic preview images. You can dynamically replace the content of the layer and warp any images on a surface defined using the Smart Object. It is useful to build 3D previews for the personalized goods like bottles, cups, t-shirts, books, stationary, etc.

Export hi-res images

The final step is to merge the template with the personalized data into a print-ready hi-res file. You can specify output resolution, color space (RGB or CMYK) and, of course, output format:

  • JPEG
  • TIFF
  • PNG
  • PDF (with text as vector data)
  • EPS (with text as vector data)

You can also serialize the state of your template and save it, to allow you to open and edit later on.