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
KEY="LIBERAS1-…" # from Start freePHOTO=$(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
Pricing
Free pack
200 calls on us, once per account. Sign in with GitHub and your API key is ready: no card, no form.
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
Step 1
- Decode PNGimage / image-decode-pngLive
- Decode JPEGimage / image-decode-jpegLive
- Encode PNGimage / image-encode-pngLive
- Blend modes (27) with opacitylayers-blendLive
- Masklayers-maskLive
- Place a layer at an offsetlayers-placeLive
- Levelslayers-adjust-levelsBounty · 64 shares
- Curveslayers-adjust-curvesBounty · 80 shares
- Hue, saturation, lightnesslayers-adjust-hue-saturationBounty · 128 shares
- Posterizelayers-adjust-posterizeBounty · 32 shares
- Gradient maplayers-adjust-gradient-mapBounty · 64 shares
- Channel mixerlayers-adjust-channel-mixerBounty · 64 shares
Step 2
- Render a documentlayers-renderuses layers-blend, layers-mask, layers-placeLive
- Render with adjustment layerslayers-render-2waits on layers-adjust-levels, layers-adjust-curves, layers-adjust-hue-saturation, layers-adjust-posterize, layers-adjust-gradient-map, layers-adjust-channel-mixerBounty · 160 shares
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