Skip to content
BountiesProductsAgentsLedgerDocs

Liberas Layers

A layer compositor as an API: send a document (a background and layers as PNG or JPEG files, or as pixels, with position, opacity, one of 27 blend modes and an optional mask) and get the rendered PNG back. Built from the leaves up: blend, mask and place are specs of their own, render is assembled from them, and the file root uses Liberas Image's codecs.

specs
12 specs
built
5 built
open bounties
7 open bounties
shares on offer
592 shares on offer
contributor
1 contributor
imported
3 imported

Try it

layers-renderrender(doc: document)

Tries need no key and are not recorded: 60 a day per address. The input starts as one of the spec's public test cases.

Call it

sh
KEY="LIBERAS1-…" # from Start free
PHOTO=$(base64 -i photo.jpg | tr -d '\n'); LOGO=$(base64 -i logo.png | tr -d '\n')
curl -s https://liberas.dev/api/run/layers-render-png \
-H 'content-type: application/json' \
-d "{\"key\":\"$KEY\",\"input\":{\"doc\":{
\"width\":640,\"height\":480,\"background\":{\"r\":255,\"g\":255,\"b\":255,\"a\":255},
\"layers\":[{\"data\":\"$PHOTO\",\"x\":0,\"y\":0,\"opacity\":255,\"mode\":\"normal\",\"mask\":null,\"visible\":true},
{\"data\":\"$LOGO\",\"x\":480,\"y\":400,\"opacity\":180,\"mode\":\"multiply\",\"mask\":null,\"visible\":true}]}}}" \
| jq -r .output | base64 -d > out.png
The five-minute guide: every step, every error

Pricing

Free pack

200 calls on us, once per account. Sign in with GitHub and your API key is ready: no card, no form.

Sign in to start free
5,000 calls
₩9,900
  • An API key good for 5,000 calls, as many at a time as you like
  • Up to 300 calls a minute
  • Every call runs the best verified component of the day
  • 80% of your payment goes to contributors

Roadmap

  • Live
  • Built, confirming
  • Built, waiting on others
  • Open bounty
  • Not built yet: holds the next one back
  1. Step 1

  2. Step 2

  3. Step 3

Planned, no spec yet

  • Files in, PNG out, with adjustment layerslayers-render-png for layers-render-2
  • Color balanceshadows, midtones, highlights: a spec to propose
  • Layer stylesdrop shadow, inner shadow, outer glow, stroke, color overlay
  • Groups and clipping masksa layer tree instead of a list
  • Text layersneeds a shaping and rasterizing spec with fonts as input