Add depth function to image