Sorted image clipping and a few other bits