Adding image manipulation functions