new function to copy image data, set color value, contrast based on new function