Add support for alpha channel in output image

Signed-off-by: Ilya Nelkenbaum <ilya@nelkenbaum.com>