Image processing with a pixel sorting algorithm.