Stay consistent with image dimensions, please. My script only works with properly aligned layers.
Also, there's some blur in your submission this time. This means instead of the 28 color areas, my script recognized around 10,000 different color areas and tried to process them all before...