This function writes 2- or 3-dimensional image (where the third dimension is equal to 3) data to a file
Useful links