Color chaining
How color-related transformations, overlays and masks interact.
TwicPics provides seven color-related transformations:
- three direct coloring transformations:
- four colorblindness filters:
In addition, it is possible to add both a mask and an overlay in your path configuration.
Direct coloring transformations
Like any other transformation in the TwicPics API, the order of background, border, and colorize transformations in your manipulation is respected:
border=red/colorize=monochrome
will colorize the given border and the end result will be a dark gray border color,colorize=monochrome/border=red
will not colorize the given border because it's specified after the colorize transformation and thus, the end result will be a red border color.
Same goes for the background transformation.
Multiple colorize transformations will be applied in order.
Mask
Translucency created by the mask is considered as border and will be filled with:
- the end border color if provided,
- otherwise the end background color if provided,
- otherwise it will simply stay translucent.
Overlay
The overlay is added after:
- any direct coloring transformation (background, border, and colorize) has been applied,
- and the mask has been applied.
The overlay is thus immune to colorization and masking.
Colorblindness filters
Colorblindness filters (achromatopsia, deuteranopia, protanopia, and tritanopia) are "global" and applied at the very end of our image processing process, so after:
- every background, border, and colorize transformation has been applied,
- the mask has been applied,
- and the overlay has been added in.