Sample code for image processing