Arko
Arko is a small library providing three pixel manipulation algorithms :
- Brush : Create some kind of brush effect
- Slim : Copy a pixel over a ramdom numbers of pixel on the same line or column
- Sort : A classic pixel sorting
The library also contains a minimal image convertion tool (supporting png and jpg).
How to use it
All of the algorithms can be used in four directions :
- bottom to top
- left to right
- right to left
- top to bottom
For algorithms using colors here are the complete list of available colors : "white", "black", "grey", "red", "yellow", "green", "cyan", "blue", "magenta".
Brush
Params :
- in_img(str) : path to the input image
- out_img(ste) : path to the output image
- force_ouput_overwrite(bool) : flag to allow overwriting of the output image if present
- proba(i32) : the probability for the algorithm to have effect on a pixel
- min(i32) : the minimum of pixel affected when the algorithm starts
- max(i32) : the maximum of pixel affected when the algorithm starts
Examples :
;
brush_left_to_right;
brush_right_to_left;
brush_top_to_bottom;
brush_bottom_to_top
Slim
Probability global
When using these functions the probability is the same applyed to all colors.
Params :
- in_img(str) : path to the input image
- out_img(ste) : path to the output image
- force_ouput_overwrite(bool) : flag to allow overwriting of the output image if present
- proba(i32) : the probability for the algorithm to effect the next pixel when activated
- colors(Vec) : the list of colors affect by the algorithm
Examples :
let colors = vec!;
slim_bottom_to_top_global;
slim_left_to_right_global;
slim_right_to_left_global;
slim_top_to_bottom_global;
Probability per colors
When using these functions the probability is provided per color.
Params :
- in_img(str) : path to the input image
- out_img(ste) : path to the output image
- force_ouput_overwrite(bool) : flag to allow overwriting of the output image if present
- colors_proba(Vec<(Colors, i32)>) : affected colors with their probability
Examples :
;
slim_left_to_right_per_color;
slim_right_to_left_per_color;
slim_top_to_bottom_per_color;
slim_bottom_to_top_per_color
Sort
Brut
These functions will affect the entire image and sort pixels either horizontally either vertically.
Params :
- in_img(str) : path to the input image
- out_img(ste) : path to the output image
- force_ouput_overwrite(bool) : flag to allow overwriting of the output image if present
Examples :
;
sort_brut_left_to_right;
sort_brut_right_to_left;
sort_brut_top_to_bottom;
sort_brut_bottom_to_top
Smart
Params :
- in_img(str) : path to the input image
- out_img(ste) : path to the output image
- force_ouput_overwrite(bool) : flag to allow overwriting of the output image if present
- detection_type(i32) :
- 0 : detection by lightness
- 1 : detection by color group
- detection_min(i32) : the minimum of pixel affected when the algorithm starts (first range)
- detection_max(i32) : the maximum of pixel affected when the algorithm starts (first range)
- multiple_range(bool) : either use one or two ranges
- detection_min_2(i32) : the minimum of pixel affected when the algorithm starts (second range)
- detection_max_2(i32) : the maximum of pixel affected when the algorithm starts (second range)
- sorting_by(i32) :
- 0 : sorting by hue
- 1 : sorting by saturation
Examples :
;
sort_left_to_right;
sort_right_to_left;
sort_top_to_bottom;
sort_bottom_to_top
Converter
Params :
- in_img(str) : path to the input image
- out_img(ste) : path to the output image
- force_ouput_overwrite(bool) : flag to allow overwriting of the output image if present
Examples :
;
convert