If you're familiar with the CNN which are used to perform the task of image classification how they are able to do that? Answer lies in the first word that is the convolutions. Convolutions helps to extract the important features for the neural network to learn a complex non-linear function. These convolutional layers as we go deeper are able to recognize even more complex features of input images means a convolutional layers break down an image in multiple layers which contain simple and the complex style representation of an image.
These extraction and power of the convolutions to recognize the features of an image has been leveraged to develop this technique of style transfer. During this process it has been ensured that the main content of the image remain preserved along with gaining he style representations of the desired image.
Please go through the notebook attached with this repo go get a better understanding of the technical details of the same. Also refer to the research paper of authors who developed this technique of Artistic Neural Style Transfer.
Read the notebook on kaggle: NST Notebook