adding image processing functions