AI Style Transfer Tips

Style transfer (where AI takes the style from one image and transfers it to another) is a technique which is often experimental. Not only do we need to take into account the style and base image, predicting what the combination of the two may look like, there’s also the addition of the AI – which quite often appears to have a mind of its own.

However, even so, there are some tips which will help you create great looking finished images in Deep Dream Generator and other style transfer platforms.

Suggestions Not Rules

Before we move on 🙂 it’s important to note that these are suggestions and not rules! With an almost endless number of base image and style combinations, what works great for one may not work so well for another. Therefore take these tips as examples and then dig in and try your own thing and see what results you get!

All base photos used in this article are from Pixabay and the examples created in Deep Dream Generator.

Use a Good Quality High Resolution Image

To a degree, the output will only be as good as the input. While the style transfer will work on low resolution images, if the image is fuzzy, pixelated or out of focus, this will of course affect the finished results.

The size of the original image will affect the results because the AI has more pixels to work with. In the example below, the image on the left was 3200 pixels wide when I uploaded it and the image on the left was 640 pixels wide.

While Deep Dream Generator resizes the images when uploaded, you can see there’s a little more detail still in the larger image.

However the output size has an affect here too.

The comparison below shows the difference between the smallest size resolution and the middle resolution. In particular, look at the highlights in the left eye. This shows how crisper the definition is in the larger resolution image.

However, remember it costs more energy to produce the larger images, so it’s worth practicing on the smallest resolution and only using the larger resolution for finished output.

Choose A Base Image with Contrast and Texture

The image below has plenty of detail, contrast and texture for the AI to work with. You can see in the slideshow below how this gave plenty of opportunity for AI to work its magic!

However, if there’s not too much contrast or definition, the AI gets lost when applying the style transfer. This doesn’t mean it’s bad (no art is bad, beauty is in the eye of the beholder), it just means the pattern is perhaps less defined as we see in the rhino image below.

You can see, when you move the slider across the image, that the definition around the rhino’s head and shoulders isn’t clear. That gives a more softer edge to the rhino.

In the image below, I’ve used a different rhino base image. In this photo the rhino is standing out from the background. When the new style has been transferred, you will see when you drag the slider across that there’s a tighter definition and border around the rhino.

and this lends itself better to different textures such as the one I used below where the rhino clearly stands out from the background even though it’s a color scheme with only subtle variations in color.

Experiment with the Settings

While great looking images can be achieved using the default settings, adjusting the settings results in different looks. The key settings to experiment are as follows:

Iterations

In style transfer platforms such as Deep Dream Generator, we have the option to adjust the number of iterations (the number of times the process is repeated).

Adjusting this figure will give subtle differences in the results. In the example below, the lion on the left was created using the default iteration number, the lion on the right was created using iteration boost 2 which I believe means it had twice the number of iterations.

The differences are very subtle, however if you look at the small swirls in the lions mane, you can see more definition in the image which was created with iteration boost 2.

Below I’ve presented the two images side by side so you can see the difference.

Increasing the iteration number increases the energy cost in Deep Dream Generator, so it’s up to you to decide if it’s worth it. However, when you have found a base image and style transfer you love, it could be worth experimenting at that point.

Style Weight

Perhaps this is more obvious, however the style weight changes the way the style reacts with the base image. The higher the style weight, the more it influences the base image.

In the image below, created in Deep Dream Generator, we’re comparing the style weight of 80% vs 20%.

Both variations are interesting and show how the style weight can affect the results.

Preserve Colors

Another option which is worth exploring is the option to ‘preserve colors’.

If the ‘Preserve Colors’ option isn’t switched on, the finished image will take on the colors of the style. If this option is switched on, the original colors of the base image shine through so it is mainly the texture and pattern of the style image which is applied.


Hopefully this will have given you some ideas for how to create some great looking images using style transfer techniques.

Leave a Reply

Your email address will not be published. Required fields are marked *