I just had time to review this :-)
, , , ImageMagick , , . , , () 0 1, ImageMagick 16- -. , OpenCV, , , .
, ... " , , / ( 8-, 8-, 1-) / (8- 8- )?"
, , ImageMagick , , , OpenCV.
, 16- , :
convert -size 300x300 gradient:black-white -alpha set -region 100x100+100+100 -alpha transparent image.tif

, :
identify -verbose image.tif | head -14
Image: image.tif
Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 300x300+0+0
Units: PixelsPerInch
Type: GrayscaleAlpha
Base type: Grayscale
Endianess: LSB
Colorspace: Gray
Depth: 16-bit
Channel depth:
gray: 16-bit <--- 16-bit greyscale data
alpha: 1-bit <--- 1-bit alpha
8- - 8- :
convert image.tif \
\( +clone -resize x1! -channel A -fx "i/w" \) \
-append -depth 8 result.tif

:
identify -verbose result.tif | head -16
Image: result.tif
Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 300x301+0+0 <--- one extra row
Units: PixelsPerInch
Type: GrayscaleAlpha
Base type: Grayscale
Endianess: LSB
Colorspace: Gray
Depth: 8-bit
Channel depth:
gray: 8-bit <--- 8-bit data
alpha: 8-bit <--- 8-bit alpha
8- RGB 8- alpha:
convert image.tif \
\( +clone -resize x1! -channel RGBA -fx "rand()" \) \
-append -depth 8 result.tif

:
Image: result.tif
Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 300x301+0+0 <--- 1 extra row
Units: PixelsPerInch
Type: TrueColorAlpha
Base type: TrueColor <--- Truecolour
Endianess: LSB
Colorspace: sRGB <--- RGB
Depth: 8-bit
Channel depth:
red: 8-bit <--- 8-bit red
green: 8-bit <--- 8-bit green
blue: 8-bit <--- 8-bit blue
alpha: 8-bit <--- 8-bit alpha