python - Create image file from array -
essentially problem finding easy way create image file array. my problem unparsing cups raster files images. cups rgb raster file header 1800 bytes. if input width , height can read raster array contained in file correctly photoshop in mac order, interleaved 16 bit data 00rrggbb. have written utility extracts width , height header. i'd write command-line utility takes width, height , file-name inputs, truncates first 1800 bytes off raster file, , creates tiff or bmp or whatever easiest write image array contained in rest - well-known image format do. program should c or python, run under mac, linux. for python, pil tool task. use putdata() (search link putdata) method on image objects put pixels list image.