CogniBlock docs
Build an image pipeline out of blocks, wire them together, and watch every step update live. Everything runs in your browser.
Overview
A pipeline is a set of blocks connected by wires. Each block does one job: it takes an image in, changes it, and passes an image out. Put an Image block at the start, a few filters in the middle, and an Output block at the end, and you have a pipeline.
The playground shows a small preview inside every block, so you can see exactly what each step does to the picture and change a setting to see it update straight away.
Quick start
- Open the playground. It starts with a working example: an image goes through
Canny EdgeandBlur, then blends back over the original. - Move a slider on any block, for example Weak edges on
Canny Edge. Every block after it updates. - Add a block by clicking it in the library on the left. It appears in the middle of your view.
- Drag from the dot on the right edge of one block to the dot on the left edge of another to connect them.
- Press Download PNG on an
Outputblock to save the result, or Share link to send the pipeline to someone.
Using the playground
Connecting blocks
- Drag from an output dot (right edge) to an input dot (left edge). The target dot lights up when you are over it.
- An output can feed any number of blocks. An input accepts exactly one wire; connecting a new one replaces the old one.
- To disconnect, grab a connected input dot and drop the wire on empty space. To re-route, drop it on a different input.
- Loops are not allowed. If a connection would make a block depend on itself, it is refused with a message.
- A block with a missing input shows Connect an input instead of a preview.
Moving around
| Action | How |
|---|---|
| Move a block | Drag its title bar |
| Pan the workspace | Drag empty space |
| Zoom | Scroll wheel, or the + and − buttons |
| See everything | Fit button |
| Remove a block | Click its ×, or select it and press Delete |
| Use your own image | Upload your own image on an Image block, or drop an image file onto the workspace |
Examples
The Examples menu loads a ready-made pipeline: Glowing edges, Edge sketch, Blueprint and Brand pixels. Reset returns to the starter pipeline. Your work is saved in your browser automatically and comes back next time you visit.
Blocks
Every block takes images in on the left and passes one image out on the right, except Image (no inputs) and Output (no output).
| Block | Inputs | What it does |
|---|---|---|
| Image | none | Starts a pipeline with a sample or your own picture |
| Grayscale | 1 | Removes all colour |
| Blur | 1 | Softens fine detail |
| Light | 1 | Changes brightness and contrast |
| Invert | 1 | Flips every colour |
| Threshold | 1 | Turns the picture into pure black and white |
| Canny Edge | 1 | Draws the edges of shapes as white lines on black |
| Pixelate | 1 | Makes a chunky mosaic |
| Duotone | 1 | Maps dark and light to two colours you choose |
| Resize | 1 | Scales the picture up or down |
| Blend | 2 (A, B) | Mixes two pictures together |
| Output | 1 | Shows the final result and downloads it |
Image
image.sourceThe start of a pipeline. Pick a built-in picture or use your own.
| Setting | Values | Notes |
|---|---|---|
| Picture | Shapes, Blocks, Gradient, Your upload | The samples are 420 × 300 px. Your upload is available once you have loaded a file. |
Uploaded images are scaled so the longest side is at most 420 px. This keeps every block fast. Uploads are not part of a shared pipeline (see Sharing).
Filter settings
| Block | Setting | Range | Notes |
|---|---|---|---|
| Blur | radius | 0 to 12 px | 0 passes the picture through unchanged. Uses a Gaussian blur. |
| Light | brightness | −100 to 100 | Adds or removes light |
contrast | −100 to 100 | 0 is unchanged | |
| Threshold | level | 0 to 255 | Pixels at or above the level become white, the rest black |
| Pixelate | size | 2 to 40 px | Each square takes the average colour of its pixels |
| Duotone | dark, light | two colours | Darkest pixels become dark, brightest become light, everything else blends between |
| Resize | scale | 10 to 200 % | Result is kept between 16 and 900 px on each side |
| Grayscale, Invert | No settings. | ||
Canny Edge
image.cannyA classic edge detector. It smooths the picture, finds where brightness changes fastest, thins those changes to single-pixel lines, then keeps strong edges and any weak edges that touch them. The result is white lines on a black background.
| Setting | Range | What it does |
|---|---|---|
Smoothing sigma | 0.5 to 4 | Higher values ignore small details and noise |
Weak edges low | 0 to 100 % | The minimum strength for a line that is connected to a strong one |
Strong edges high | 0 to 100 % | The strength a line needs to start on its own |
Both thresholds are a percentage of the strongest edge in the picture. If you get too many lines, raise Strong edges or Smoothing. If lines are broken, lower Weak edges.
Blend
image.blendMixes input A with input B. If B is a different size, it is stretched to match A. With only A connected, Blend passes A through unchanged.
| Mode | Result |
|---|---|
normal | Shows B |
multiply | Darkens: dark areas of either picture win |
screen | Lightens: bright areas of either picture win. Good for glowing edges. |
difference | Shows how different the two pictures are. Identical pictures give black. |
add | Adds the brightness of both, capped at white |
Mix (0 to 100 %) controls how much of the blended result replaces A. At 0 you see A, at 100 you see the full effect.
Output
image.outputShows whatever is connected to it and lets you download it as a PNG at the size shown under the preview. You can add more than one Output block to compare branches of the same pipeline.
Pipeline format
A pipeline is a small JSON document. This one is the Edge sketch example reduced to three blocks:
{
"v": 1,
"nodes": [
{ "id": "n1", "type": "image", "x": 0, "y": 20, "params": { "sample": "shapes" } },
{ "id": "n2", "type": "canny", "x": 250, "y": 20, "params": { "sigma": 1.4, "low": 6, "high": 18 } },
{ "id": "n3", "type": "output", "x": 500, "y": 20, "params": {} }
],
"links": [
{ "from": "n1", "to": "n2", "port": 0 },
{ "from": "n2", "to": "n3", "port": 0 }
]
}
| Field | Meaning |
|---|---|
v | Format version. Always 1 for now. |
nodes[].id | A unique id like n1, n2, … |
nodes[].type | image, grayscale, blur, brightness, invert, threshold, canny, pixelate, duotone, resize, blend or output |
nodes[].x, y | Where the block sits on the workspace |
nodes[].params | The block's settings, using the setting names in the tables above. The Light block's type is brightness. |
links[].from | The id of the block whose output the wire starts at |
links[].to, port | The block the wire ends at, and which input: 0 for the first (or only) input, 1 for Blend's B |
Sharing API
The share button talks to a small HTTP API at /api/pipelines. You can use it from your own tools. It is the same format described above.
Save a pipeline
POST /api/pipelines
Content-Type: application/json
{ "graph": { "v": 1, "nodes": [ ... ], "links": [ ... ] } }
201 { "id": "04d66a5ae8" } // saved
200 { "id": "04d66a5ae8" } // this exact pipeline was already saved
Load a pipeline
GET /api/pipelines?id=04d66a5ae8
200 { "graph": { ... } }
Errors
| Status | When | Body |
|---|---|---|
400 | Not valid JSON, not a valid pipeline, or a bad id | { "error": "…" } says what was wrong |
404 | No pipeline has that id | { "error": "Pipeline not found" } |
405 | Any method other than GET and POST | { "error": "Method not allowed" } |
413 | The request is larger than 20 KB | { "error": "Pipeline is too large" } |
429 | More than 30 new saves in an hour from one address | { "error": "Too many saves, try again in an hour" } |
Every save is checked against the list of blocks and settings. Unknown blocks and settings are rejected, numbers outside a block's range are clamped, and colours must be #rrggbb.
Limits and privacy
| Limit | Value |
|---|---|
| Blocks per pipeline | 40 when saving a share link (the playground itself does not stop you earlier) |
| Wires per pipeline | 80 when saving a share link |
| Size of a saved pipeline | 20 KB |
| New share links per hour | 30 per address |
| Uploaded image size | Longest side scaled to 420 px |
| Resize block output | 16 to 900 px per side |
| Imported file size | Up to 200 KB |
What leaves your device
- Images you upload or generate stay in your browser. They are never sent anywhere.
- Pressing Share link sends the pipeline's blocks and settings to the sharing API. Nothing else.
- Your work is autosaved in your own browser's local storage so it is there when you come back. Clearing site data removes it.
FAQ
Are the blocks AI models?
Not yet. The current blocks use classic image-processing algorithms, such as Gaussian blur and Canny edge detection, running directly in your browser. They are real, fast and free to run. Blocks backed by machine-learning models are not available yet.
Why does my shared pipeline use a different picture?
Share links never include uploaded images. The link falls back to the Shapes sample. Send the image separately, and the other person can load it into the Image block.
My image looks small or soft.
Uploads are scaled to 420 px on the longest side so every block stays fast. Use Resize to scale a result up for preview, but note it cannot add detail that is not there.
A block shows “Connect an input”.
Its input has no wire, or the block before it has no input of its own. Follow the chain back to an Image block and make sure each step is connected.
The share button says links only work on the live site.
The sharing API is part of the deployed site. When you open pipelines.html straight from your computer, or from a basic local server, the API does not exist. Export and Import work everywhere.
Does it work on a phone?
Yes, the editor is usable with touch, but a larger screen makes wiring much easier.
