Quick Start Guide

This guide assumes you have access to a ProcBlocks job queue and are able to edit templates and process jobs.

A job definition defines a photo editing workflow in YAML.

Let's take a look at a simple job definition.

# Hello World
- processor:
    processor: "text"
    inputs:
      source: "input/input.png"
    params:
      text: "Hello, World!"
      font: "gf:Roboto:normal"
      size: 40
      color: "white"
      anchor: "rel(0.5,0.5)"
    outputs:
      target: "output/output.png"

This loads input/input.png (upload location), renders "Hello, World!" over it, and then outputs the results to output/output.png (assumed output location).

Most definitions will load the uploaded image and save to the output location but a lot can happen in-between.

- processor:
    processor: "color_transform"
    inputs:
      source: "input/input.png"
    params:
      effect: "sepia"
      intensity: "1.0"
    outputs:
      target: "mem/work.png"

- processor:
    processor: "composite"
    inputs:
      background: "mem/work.png"
      overlay: "account/watermark.png"
    params:
      background_anchor: "rel(1.0,1.0)" # bottom-right of the framed image
      overlay_anchor: "rel(1.0,1.0)" # bottom-right of the watermark
      width: 50 # scale watermark to 50 px wide
      opacity: 0.5 # 50% transparent
      mode: "normal"
    outputs:
      target: "mem/work.png"

- processor:
    processor: "frame"
    inputs:
      source: "mem/work.png"
    params:
      composite: "True"
      size: 10
      color: "#FFFFFF"
    outputs:
      target: "output/output.png"

What’s happening here?

  1. Sepia filter Loads input/input.png (upload location), applies a sepia effect at full intensity (1.0), and writes the result to mem/work.png (server memory).
  2. Watermark composite Uses mem/work.png as the background and overlays account/watermark.png (image from account store) at the bottom-right corner (both anchors set to rel(1.0,1.0)), scales the watermark to 50 px wide, applies 50% opacity, and writes the composited image back to mem/work.png (overwrites server memory).
  3. White frame Reads the watermarked image from mem/work.png, draws a 10 px white border around it (with compositing enabled), and saves the final output to output/output.png.

It's easy to tackle advanced workflows by arranging block stacks. This is the foundation of the ProcBlocks system.

Do you want to know more?