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?
- Sepia filter
Loads
input/input.png
(upload location), applies a sepia effect at full intensity (1.0
), and writes the result tomem/work.png
(server memory). - Watermark composite
Uses
mem/work.png
as the background and overlaysaccount/watermark.png
(image from account store) at the bottom-right corner (both anchors set torel(1.0,1.0)
), scales the watermark to 50 px wide, applies 50% opacity, and writes the composited image back tomem/work.png
(overwrites server memory). - 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 tooutput/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?
- JobFS: The virtual filesystem that binds the blocks together.
- ProcBlocks Syntax: Learn all three block types.
- Advanced Parsing: Make your templates dynamic.
- Fields: Define custom inputs.