Cleaned up 24bit color to 16bit color perl script