neural-style: An open source alternative to Prisma (for advanced users)

Recently we stumbled upon a very interesting project, it is called neural-style which is a torch implementation of an artificial system based on a Deep Neural Network that attempts to create artistic images of high perceptual quality.

According to the authors, this tool is based on the paper of Leon A. Gatys, Alexander S. Ecker and Matthias Bethge which is called “A Neural Algorithm of Artistic Style” (which is available to read for free here).

What this tool does is ‘simple’, it takes as input two images, the style image and the content image and using the style image, it tries to recreate the content image in such way that the content image looks like it was created using the same technique as the style image.
Following, is an example of a photograph that was recreated using the style of The Starry Night.

This tool offers a ton of possibilities and options, which we still did not play through yet.
Overall, we are very happy with the initial results we got. The final renderings look really nice and the fact that you get to choose your own style images it gives this tool a very nice advantage.

What we did not like though, is that it takes a lot of time and memory to complete the rendering of a single image (especially if you do not use a GPU to speed up the process).
This issue with the resources is normal and expected, unfortunately though it limits the fun out of the system. Each experiment you make is blocking you for some time and you cannot fiddle with the results in real time.

We installed this tool both on a Fedora GNU/Linux and on an Ubuntu with success.
Following are the exact commands we used to install it on Ubuntu and convert our first image (the one above).

cd ~;
git clone ~/torch --recursive;
cd ~/torch;
bash install-deps;
source ~/.bashrc;
sudo apt-get install libprotobuf-dev protobuf-compiler;
CC=gcc-5 CXX=g++-5 luarocks install loadcaffe;
luarocks install cutorch
cd ~/
git clone;
cd neural-style/;
sh models/;
#After everything is complete, it is time to create our first 'artistic' image.
th neural_style.lua -num_iterations 1500 -image_size 1250 -gpu -1 -style_image "/home/bytefreaks/Pictures/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg" -content_image "/home/bytefreaks/Pictures/Aphrodite Hills Golf Course - Paphos, Cyprus.jpg"

Our input images were the following:

Content Image

Style Image

Below are the intermediate steps the tool created until it reached the final rendered image.

This slideshow requires JavaScript.

Useful links


Hugin 1

Hugin is a cross-platform open source panorama photo stitching and HDR merging program developed by Pablo d’Angelo and others. It is a GUI front-end for Helmut Dersch’s Panorama Tools and Andrew Mihal’s Enblend and Enfuse. Stitching is accomplished by using several overlapping photos taken from the same location, and using control points to align and transform the photos so that they can be blended together to form a larger image. Hugin allows for the easy (optionally automatic) creation of control points between two images, optimization of the image transforms along with a preview window so the user can see whether the panorama is acceptable. Once the preview is correct, the panorama can be fully stitched, transformed and saved in a standard image format.

— From Wikipedia:

We have a set of images, which if stitched together they can produce a panorama. We wanted to create a panoramic ‘artwork’ using Prisma (because we like their work).
Unfortunately, a current limitation of Prisma, is that it will only produce square images of maximum size 1080px, so we could not supply it with a panorama an expect it to create the panoramic ‘artwork’.

To achieve our goal, we converted our images to ‘art’ using Prisma and we supplied the result to Hugin to create the panoramic ‘artwork’.
By using the simple wizard of Hugin we were able to create these lovely images presented in this post.

Note: Since the images we loaded into Hugin were processed by Prisma, they lost all their EXIF information.
Because of the missing EXIF information, Hugin could not know the focal length of the camera so we had to supply it manually.
In our case, for Galaxy S4 it was 35mm. After supplying this information everything went smoothly as you can see in the results.

We created two sets of images, one using the Mosaic filter (above) and another using the Dallas filter (below).

Useful links:

marits0ui on Instagram

Instagram profile page of <a href="" target="_blank">marits0ui</a>

Instagram profile page of marits0ui

This slideshow requires JavaScript.

Instagram profile page of <a href="" target="_blank">marits0ui</a>
Instagram profile page of <a href="" target="_blank">marits0ui</a>
Instagram profile page of <a href="" target="_blank">marits0ui</a>Previous Collection

marits0ui on Instagram

Instagram profile page of <a href="" target="_blank">marits0ui</a>

Instagram profile page of marits0ui

This slideshow requires JavaScript.

Instagram profile page of <a href="" target="_blank">marits0ui</a>
Instagram profile page of <a href="" target="_blank">marits0ui</a>
Instagram profile page of <a href="" target="_blank">marits0ui</a>More Recent Collection


This slideshow requires JavaScript.

The blue filter observed in this picture is the Electric filter from the Prisma application of Prisma Labs.

Prisma is a photo-editing application that utilizes a neural network and artificial intelligence to transform the image into an artistic effect.
— From Wikipedia:

The scary looking creature photographed is a fictional character from the Warcraft franchise and it is called a Murloc:

The murlocs are amphibious bipedal fish-like creatures, which dwell along the coastlines of the Eastern Kingdoms, and few other locations. Little is known about this species, although they seemingly have enough intellect to form societies and tribes, even having their own faith system. They have their own spoken language, although it is unpronounceable in the common tongue.
— From Wikipedia:

Useful links:

In this gallery we added along with the original and the filtered pictures some more that use half of the original picture and half of the filtered picture to better show how the effect altered the original picture.


  • Prisma only accepts square images and it will resize the produced result to 1080px if the input image is larger than that.
  • The creation of the mixed images was done manually using Gimp.
  • We added the text at the end of the images using the following set of commands on a GNU/Linux environment (specifically Fedora) using bash shell and the imagemagick suite:
mkdir "$folder";
for img in *.jpg;
  width=`identify -format %w "$img"`;
  convert -background '#0008' -fill white -gravity center -size ${width}x30 caption:"©" "$img" +swap -gravity south -composite "./$folder/$img";

The filtered images were added to the sub-folder called “modified” while the original images were not changed at all.

Photo ClubΦωτογραφικός Όμιλος

The Photo Club of the University of Cyprus was established in 1993.


Our aim is the development of photography and we try to achieve this by the means of courses, lectures, workshops, photography exhibitions, trips and screenings to the University. In some cases we might process black and white film in the darkroom of the University. Anyone can become a Club member as long as they are students at the University of Cyprus and provided that they love photography even though they have not taken the first difficult steps in the photographic art:).


Our meetings happen regularly once a week (day and time of the changes every semester) where we implement short talks or lectures (~ 1 hour).


email:[email protected]

site:http://photoclub.bytefreaks.netΟ Φωτογραφικός Όμιλος του Πανεπιστημίου Κύπρου ιδρύθηκε το 1993.


Στόχος μας είναι η ανάπτυξη της φωτογραφίας και προσπαθούμε να το πετύχουμε δια μέσω μαθημάτων, διαλέξεων, εργαστηρίων, εκθέσεων φωτογραφίας, εκδρομών και προβολών στο Πανεπιστήμιο Κύπρου. Ακόμη, σε κάποιες περιπτώσεις θα μπορούσαμε επεξεργαστούμε ασπρόμαυρο φιλμ στον σκοτεινό θάλαμο του Πανεπιστημίου. Οποιοσδήποτε μπορεί να γίνει μέλος του ομίλου, εφόσον είναι φοιτητές στο Πανεπιστήμιο Κύπρου και υπό τον όρο ότι αγαπά τη φωτογραφία, ακόμη κι αν δεν έχει κάνει τα πρώτα δύσκολα βήματα στη φωτογραφική τέχνη:).


Συνεδριάσεις μας γίνοντε τακτικά μία φορά την εβδομάδα (μέρα και ώρα αλλάζει κάθε εξάμηνο) όπου κάνουμε σύντομες ομιλίες ή διαλέξεις (~ 1 ώρα).


email: [email protected]