Images may be manipulated by performing image operations. You can instruct sic to perform image operations by means of the image script or by specifying image operations directly through the CLI interface. Image script can used by providing commands to --apply-operations "", or by loading a script from a file using --operations-script. Please refer to the --help page if you want to use operations from the CLI instead. Image operations are always applied from left-to-right. Image script commands: ---------------------- |-------------------|-----------------------------------| | operations | syntax* | |-------------------|-----------------------------------| |blur | `blur ` | |brighten | `brighten ` | |crop | `crop `| |diff | `diff ` | |draw-text | `draw-text | | | ` | |filter3x3 | `filter3x3 ` | |flip horizontal | `flip-horizontal` | |flip vertical | `flip-vertical` | |gray scale | `grayscale` | |horizontal gradient| `horizontal-gradient | | | ` | |hue rotate | `hue-rotate ` | |invert | `invert` | |overlay | `overlay ` | |resize | `resize ` | |rotate90 | `rotate90` | |rotate180 | `rotate180` | |rotate270 | `rotate270` | |unsharpen | `unsharpen ` | |vertical gradient | `vertical-gradient | | | ` | |-------------------|-----------------------------------| Legend: : positive number in range 0-255 : positive number : positive or negative number : a real number : 9 succeeding real numbers : a path to an image reachable from your current working directory (surround the path by "quotation marks") : a valid unicode string : a coordinate (top left is (0, 0)), with syntax: `coord(, )` : an RGBA color, with syntax: `rgba(, , , ) ` : a font size, with syntax: `size()` : a font file location, with syntax: `font()` **modifiers** Some image operations have extra options, called modifiers, which may change the behaviour of an operation. 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: image script ---------------------- 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 instead, we will get the following: 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')" ---