Added image processing functions.