You will need to write the (complex) code to convert that array into a standard image format - taking into consideration that images in PDF can be in 9 different colorspaces, with varying bits per components, etc.