Add program for sorting within image regions