Filter definition schema¶
A filter entry is a YAML file in catalog/filters/<family>/. Its fields are defined by the JSON schema catalog/schema/catalog.schema.json, and tools/check_catalog.py checks every entry against it. The studio's TypeScript types are generated from the same schema with pnpm gen. This table is generated from the schema too.
| Field | Required | Type | Meaning |
|---|---|---|---|
id |
Yes | EntryId | The entry's id, used in URLs, files and code. Lower-case words joined by hyphens. |
name |
Yes | string | The name shown in the studio and the docs. |
aliases |
list of string | Other names for the method. The Library search finds them. | |
family |
Yes | one of linear, nonlinear, adaptive, morphology, frequency, multiscale, edges, features, enhancement, restoration, segmentation, learned, artistic, utility |
The family the entry belongs to, from families.yaml. Its file lives in that family's folder. |
alsoIn |
list of one of linear, nonlinear, adaptive, morphology, frequency, multiscale, edges, features, enhancement, restoration, segmentation, learned, artistic, utility |
Other families the entry is listed in. | |
tags |
list of Tag | Tags for the Library facets, such as purpose:denoise. | |
tier |
Yes | one of core, advanced, optional, planned, unsupported |
The scope tier: core, advanced or optional. |
engine |
Yes | one of browser, science, model, none |
Where the entry runs: browser, science (the Python engine), model, or none. |
phase |
Phase | The build phase in which the entry was added. | |
status |
Yes | one of implemented-tested, implemented-untested, partial, optional-dependency, optional-model, planned, unsupported |
The implementation status, one of the seven shared values. |
reason |
string | Why the entry is planned or unsupported. | |
planNotes |
string | Notes from planning. Not shown in the studio. | |
summary |
string | One or two plain sentences about what the entry does. | |
purpose |
string | What the entry is for, in one sentence. | |
classification |
Classification | Linearity, domain and a short operation name. | |
output |
one of image, mask, labels, features, spectrum, table, image-set |
What the entry makes: an image (the default), a mask, labels, features, a spectrum, a table or an image set. | |
representation |
one of fixed-kernel, dynamic-kernel, structuring-element, rank, frequency-response, transform, iterative, estimator, algorithm, neural, point-transfer, color-transform, random-process |
How the Inspector shows the operator, such as a kernel, a window or an algorithm. | |
representationLabel |
one of exact, definition, approximation, simplified |
How closely that representation matches the computation: exact, definition, approximation or simplified. | |
representationSource |
CodeRef | The code that builds the representation, when it is not the implementation. | |
supportRadius |
string | Halo in pixels as an expression of parameters, or 'global'. | |
supportsMask |
boolean | True when the entry can work inside a selection only. | |
needsSelection |
boolean | The filter reads the selection as an input, such as the area to fill. The studio sends it with the job and does not run the filter without one. Science engine only. | |
selectionRole |
one of area, template, markers, contour |
With needsSelection: what the selection is for. area (the default): the area the filter reads and changes, such as the hole to fill. template: only an input, a pattern to search for. markers: only an input, the seeds that regions grow from. contour: only an input, the starting contour that moves to fit the image. With template, markers or contour, the filter runs on the whole image and its result covers the whole image. | |
changesSize |
boolean | The result has another size than the image, such as an enlarged one. The entry needs a scale parameter, the factor for width and height, so the studio can check the new size first. The studio runs the filter on the whole image and scales the selection with it. Science engine only. | |
preview |
one of live, on-demand, none |
How the studio previews the entry: live while you change values, on demand, or not at all. | |
channelScopes |
list of one of rgb, per-channel, luminance, chroma |
The channel scopes the entry offers, such as RGB, each channel, brightness only or color only. | |
colorHandling |
string | How the entry treats color and alpha, in plain words. | |
boundary |
string | How the entry handles the image border, in plain words. | |
params |
list of any | The parameters, each with type, default, range, description and effect, or a ref to a shared one. | |
formula |
string | LaTeX. May contain {{param}} placeholders. | |
formulaExplanation |
string | The formula in plain words: what each part means. | |
symbols |
list of FormulaSymbol | Each symbol of the formula and its meaning. | |
steps |
list of string | The algorithm as short numbered steps. | |
pseudocode |
string | Optional pseudocode of the algorithm. | |
complexity |
Complexity | Time and memory in big-O notation, with a note on what N means. | |
useCases |
list of string | Where the entry is useful. | |
advantages |
list of string | What the entry does better than its alternatives. | |
limitations |
list of string | What the entry does poorly or cannot do. | |
artifacts |
list of string | Visible flaws the entry can make, such as halos or ringing. | |
references |
list of Reference | Papers, books and code the entry follows, with DOI or URL. | |
implementation |
CodeRef | The source file and symbol of the implementation. Required for implemented entries. | |
tests |
list of string | The test files that check the entry. Required for implemented entries. | |
dependencies |
list of Dependency | Libraries the entry needs, with their license. | |
learn |
Learn | The Learn panel content: one sentence, how it works, academic notes, things to try, pitfalls and demos. | |
related |
list of EntryId | Ids of related entries, shown under Where to go next. | |
docsPage |
string | The entry's docs page, relative to docs/. | |
command |
string | A studio command id, such as image.resize, that runs this entry instead of the filter engine. For operations that change the image size, which the tiled filter engine cannot run. | |
model |
EntryId | The id of the model in models.yaml that the filter needs. The studio shows its size and license and offers to download it. The entry's status is then optional-model. | |
modelChoices |
object | When a select parameter chooses between models: the parameter key and the model id for each of its values. model must then be the model of the default value. |
Rules beyond the schema¶
tools/check_catalog.py also checks:
- Implemented entries name an implementation file and symbol that exist, and test files that exist.
- A browser filter declares its id in code and is registered in
web/src/core/filters/registry.ts. - A science filter registers its id with
@register, in a module thefilterspackage imports. - Formulas only use placeholders of real parameters.
relatedids, families, models and docs pages exist.- An entry lives in the folder of its family.
Tools¶
Tools, such as the selection tools, use a smaller set of the same fields, in catalog/tools/. Models are in catalog/models.yaml, AI tasks in catalog/ai-tasks.yaml, and AI providers and their presets in catalog/providers.yaml.