Optical processing of images