Functions > Image Processing > Image Color Tools > Working with Packed Matrices
  
Working with Packed Matrices
subcolor(M, ir, jr, ic, jc)—Returns the submatrix from row ir to jr, column ic to jc, of packed color matrix M.
extract(M, [n])—Returns the nth color component of packed three-color matrix M. When only the color image matrix is supplied, all three components are returned in a nested matrix.
replace(M, N, n)—Returns packed image matrix M with the nth color component replaced by matrix N, which must have the same number of rows as M and 1/3 as many columns.
Arguments:
M is a packed-color matrix.
ir, jr, ic, jc are nonnegative integers that do not exceed the number of rows or columns in the matrix M. 0 is allowed as a value only when it is the chosen ORIGIN for arrays.
N is one color value in a packed-color image matrix.
n (optional for extract) is 1, 2 or 3.