There are currently two ways to perform image operations on an image. The first is by means of the cli option `--apply-operations ` (we call this method 'script operations method' or abbreviate it as 'script'). The second is by means of 'image operations as cli arguments' (this method is currently known by 'cli operations method' or abbreviated by 'cli ops'). Technically, both methods can be used from the commandline interface. An example when the script mode is useful is when applying a larger set of operations or when the operations are generated by another cli tool. The cli ops mode can be useful when you are manually calling sic as it is easier to find help information through the '--help' flag. It can also be auto completed when used in tandem with shell completions. The order in which the operations specified for both methods are applied is left-to-right. Note that you should either use the script or the cli ops mode. It is not possible to combine the methods. Supported operations: --------------------- |-------------------|-----------------------------------|------------------------| | operations | syntax* | As of version | |-------------------|-----------------------------------|------------------------| |blur | `blur ` | 0.5.0 | |brighten | `brighten ` | 0.7.0 | |contrast | `contrast ` | 0.7.0 | |crop | `crop `| 0.9.0 | |diff | `diff ` | 0.11.0 | |draw-text | `draw-text | 0.12.0 | | | ` | | |filter3x3 | `filter3x3 ` | 0.7.0 | |flip horizontal | `flip-horizontal` | 0.5.0 | |flip vertical | `flip-vertical` | 0.5.0 | |gray scale | `grayscale` | 0.7.0 | |hue rotate | `hue-rotate ` | 0.7.0 | |invert | `invert` | 0.7.0 | |overlay | `overlay ` | 0.14.0 | |resize | `resize ` | 0.5.0 | |rotate90 | `rotate90` | 0.7.0 | |rotate180 | `rotate180` | 0.7.0 | |rotate270 | `rotate270` | 0.7.0 | |unsharpen | `unsharpen ` | 0.7.0 | |-------------------|-----------------------------------|------------------------| Table 1: Supported operations * this is the syntax as used by the script method. If you like to use cli arguments instead, invoke sic with the '--help' flag; it will provide an overview of all arguments including the cli ops. This table can however still be used as a reference for supported image operations and image operation modifiers. _Table 1 legend:_ The table specifies the following types which are required as argument(s) for certain image operations: : an 8 bit unsigned integer (positive number in range 0-255 : a 32 bit unsigned integer (positive number) : a 32 bit signed integer (positive or negative number) : a 32 bit floating point number (real number) : 9 succeeding 32 bit floating point numbers : a qualified path to an image reachable from your current platform (the path should be surrounded by quotation marks) : a valid unicode string : a named value representing a coordinate (top left is (0, 0)), with syntax `coord(, )` : a named value representing an RGBA color, with syntax: `rgba(, , , ) ` : a named value representing a font size, with syntax: `size()` : a named value representing a (TrueType) font file location, with syntax: `font()` **separators** Script mode requires that operations are separated by the operation separator (the ';' character). The separator must be used with both single line and multi-line scripts. Below you'll find examples which can help you and serve as examples on where this separator should be used. **modifiers** Some image operations have extra options which may change the behaviour of an operation. We call these options image operation modifiers, or modifiers for short. Script mode allows you to set a modifier using the following syntax `set [ 0..n]`. The modifier settings can be overwritten by using the `set` command again, and can also be reset to their default value by using the `del` command. The syntax for the `del` command is as follows: `del `. The available image operation modifiers are: |===================|===========================================| | for operation: | modifier: | |===================|===========================================| | resize | preserve-aspect-ratio | | resize | sampling-filter | ----------------------------------------------------------------- |===================|===========================================| | values: | choices: | |===================|===========================================| | | true, false | | | catmullrom, gaussian, | | | lanczos3 (default), nearest, | | | triangle | ----------------------------------------------------------------- Examples: script mode --------------------- Example 1: sic --input input.png --output output.png --apply-operations "invert; hue-rotate -75; rotate90; contrast 0.25" Example 2: sic -i input.png -o output.png --apply-operations "set preserve-aspect-ratio true; set sampling-filter lanczos3; resize 250 250;" Example 3: sic -i in.png -o out.png --apply-operations "rotate180; flip-horizontal; set sampling-filter nearest; resize 75 80; huerotate 75" Example 4: sic -i in.png -o out.png --apply-operations "draw-text 'we can draw text <3' coord(10, 10) rgba(200, 10, 40, 255) size(14) font('resources/font/Lato-Regular.ttf')" Examples: cli ops mode ---------------------- If we modify the above examples to use the cli ops mode instead, we will get the following commands: Example 1: sic --input input.png --output output.png --invert --hue-rotate -75 --rotate90 --contrast 0.25 Example 2: sic -i input.png -o output.png --preserve-aspect-ratio true --sampling-filter lanczos3 --resize 250 250 Example 3: sic -i in.png -o out.png --rotate180 --flip-horizontal --sampling-filter nearest --resize 75 80 --hue-rotate 75" Example 3: sic -i in.png -o out.png --draw-text "we can draw text <3" "coord(10, 10)" "rgba(200, 10, 40, 255)" "size(14)" "font('Lato-Regular.ttf')" ---