optimisation for image processing