add condition to write a bit depth of 8 or bit
depth of 16 so can use iamge magick to show the 8bit images
added script to generate image