3.4 KiB


Filtress is an interpreter for the filtress domain-specific-language. The interpreter reads an input file (filetype frs) and processes the commands to filter/modify an input image. Due to the fact that each frs file is essentially a custom image filter, shell scripts can filter many images with the same frs file in one go. In addition to color filtering, color overlays, and image sampling are also possible.

The language

The filtress language is pretty basic as far as languages go. All filtress filters/scripts should be contained in a file with the suffix frs (ex. myFilter.frs)

All elements in a filtress script are either a procedure, a variable, an opperator, or an opperand. Opperands are always positive integer values and variables always represent positive integer values as well.

The following opperators are available: +, -, *, /, %, =. If an opperator is not passed to a procedure before an opperand then = is assumed. As such, you never have to use =, just know that that is what filtress is doing in those cases.

All opperands can be passed as variables rather than as integers directly, with the exception of loops. Loops are started with the keyword (procedure) BEG followed by a number, like so: BEG 20. Anything that comes on the following lines is a part of the loop until the keyword END. At present, due to the way loops are handled by the parser, this number cannot be filled in by a variable. Many procedures represent a data value and as such can also be used as a variable. For example: RED +100 increases the value of RED by 100. If instead a person wanted to double red they could do RED *10 or RED +RED. Multivalue procedures such as COL and LOC cannot be used as variables, nor can things that do not represent a specific value, such as APY or BEG. Similarly there are two values that cannot be used as procedures, only as variables: WID and HIG.

Aside from the above, there are a few things to know. Comments are begun with the # symbol and go until end of line. These will be ignored by the parser. Each statement, consisting of a procedure and, optionally in some cases, an expression and or comment, must be on its own line.

For a more detailed overview of each prcedure and variable please visit the filtress manual. Another good resource to check out is the example_filters folder of this repo.

Intallation, Building, Dependencies

Building filtress from source requires the Go compiler. No dependencies beyond the go standard library are required.


This software.source-code is released under the Non-Profit Open Software License 3.0. The basic gist is that you are free to view, modify, and distribute the source code and use the program to your liking, so long as you do not make money doing so and release any modifications under the same terms. There are more details in the LICENSE file that accompanies this repository. The license does not cover frs files created by users or the images created with the software.

Filtress was initially inspired by, but filtering images rather than creating audio. Interval is a super cool program that you should definitely check out. A user of both will likely notice some similarities (and likely just as many differences).