Finished adding code to flatten_image.py. Note: changes depend on nonexistent file convert_color_mode.py, which stil needs to be written. Was using colorsys to convert colors, but this did not produce the desired effect.