All images are gray, RGB, or RGBA.
Each component is in \([0,1]\).
In a uint array, each element is in \([0,255].\)
In a float array, each element is in \([0,1].\)
solid_color(w,h,c)
\(w\) and \(h\) are non-negative integers.
\(c\) is a color.
Solid color.
flip_hor(x)
\(x\) is an image.
Flip horizontally.
flip_vert(x)
\(x\) is an image.
Flip vertically.
to_float(x)
\(x\) is a uint array.
\(x/255\) cast to float.
to_uint(x)
\(x\) is a float array.
\(255x\) cast to uint.
comps(x)
\(x\) is an image.
Number of components.
1 = gray, 3 = RGB, 4 = RGBA.
to_bgr(x)
\(x\) is an image.
Gray, RGB, or RGBA, to BGR.
read(path)
path is a string.
Read image.
write(x,path)
\(x\) is an image.
path is a string.
Write image.
show(x)
\(x\) is an image.
Show image.