Is it possible to build a neural network that learns the connection between two images?

Let's say I have a number of X images that related to Y images. How can I build a neural network that takes an image as an input and outputs (generates) the output image?

The Y images are generated by applying some function to the X images.

Do I need a generate neural network for that? Are conventional neural networks capable of classification only?