Pinch android screen

I have a screen with picture, I need to pinch the screen to exit from picture to other view. How can I achieve pinch in appium? I am using latest version of java and appium.