python - Adding alpha channel to RGB array using numpy -
i have image array in rgb space , want add alpha channel zeros. specifically, have numpy
array shape (205, 54, 3) , want change shape (205, 54, 4) additional spot in third dimension being 0.0's. numpy operation achieve this?
you use 1 of stack functions (stack/hstack/vstack/dstack/concatenate) join multiple arrays together.
numpy.dstack( ( your_input_array, numpy.zeros((25, 54)) ) )
Comments
Post a Comment