Transform Photos into Art with Deep Learning

Default avatar.
August 16, 2017
Transform Photos into Art with Deep Learning.
Life is like a camera. If things don’t work out, you can take another shot. But if you get that perfect picture, you will want to capture the moment and, perhaps, transform it into a work of art. Have you ever seen art so beautiful and resonating that you wish you could transform your favorite photos into that style? Or perhaps you are a frontend developer or designer seeking an easier way to turn your images into something that’s more appealing, or fits the theme for a special occasion or unique scenario? Maybe you have been tasked to come up with a fun photo booth for a birthday party that enables attendees to transform their photos into a style of art they like? Check out the before and after of the photos below as an example: 001Before (left) and after (right) 002Before (left) and after (right) Existing platforms like Instagram and Prisma enable users to upload images, apply different filters and effects, then produce an image with a very unique style and artistic look. However, you may want to build a similar application that provides more flexibility for the type of art, as well as the kinds of images users can upload. With Cloudinary, developing a platform that enables you turn photos into art is a breeze. All you need to do is add the style_​transfer effect to any delivered image while specifying the image ID of the source artwork as its overlay and activating the Neural Artworks addon. 003Source artwork (left), target photo (center), and style transfer result (right)

A Closer Look at Style Transfer with Cloudinary

Cloudinary is a cloud-based image and video management service that includes server or client-side upload, on-the-fly manipulations, quick content delivery network (CDN) delivery and a variety of asset management options. The style transfer effect applies a complex deep learning algorithm — based on the VGG 16 neural network — that extracts artistic styles from a source image and applies them to the content of a target photograph. Cloudinary’s algorithm takes advantage of Xun Huange and Serge Belongie’s enhancement on the Gatys algorithm, which make it possible to use any image for both source and target, and still deliver a good quality style transfer in real time, using a single feed-forward neural network.  Cloudinary’s implementation is much faster than other available services, not limited to pre-learned images, and even supports high-resolution outputs that are out of scope for similar services.

How to Implement Style Transfer

To apply this effect, simply specify the public ID of the source artwork as an image overlay (l_​ in URLs) and style_​transfer as the overlay effect (e_​style_​transfer in URLs). The target photograph is the public ID of the image to deliver. For example:
http://​res​.cloudinary​.com/​d​e​m​o​/​i​m​a​g​e​/​u​p​l​o​a​d​/​w​_​700​,​h​_​700​,​c​_​f​i​l​l​/​e​_​s​t​y​l​e​_​t​r​a​n​s​f​e​r​,​l​_​s​a​i​l​i​n​g​_​a​n​g​e​l​/​g​o​l​d​e​n​_​g​a​t​e.jpg
http://​res​.cloudinary​.com/​d​e​m​o​/​i​m​a​g​e​/​u​p​l​o​a​d​/​e​_​s​t​y​l​e​_​t​r​a​n​s​f​e​r​,​l​_​d​a​v​i​n​c​i​_​m​o​n​a​_​l​i​s​a​/​g​o​l​f​_​s​a​n​d​_​s​t.jpg
004Source Artwork (left), target photo (center), and result of the style transfer effect (right) But wait, there’s more! You can include the Boolean preserve_​color option or adjust the style_​strength of the effect like so: 005Artwork (left), target photo (center), default style transfer (right) 006Preserve Original colors in Style transfer (left), adjust Style Strength to 60 in Style transfer (right)

Give Style Transfer a Try

Back to the task you’ve been assigned — creating a photo booth with effects for a birthday party. Here’s a cool, simple app that demonstrates how style transfer works.

See the Pen Style Transfer Demo by Cloudinary (@Cloudinary) on CodePen.

You can start making yours by signing up for a free Cloudinary account and activating the Neural Artworks add-on. There is comprehensive documentation available to show how you can take advantage of style transfer in your applications. You no doubt have a lot of ideas about how to turn your photos into art. With Cloudinary, it’s easy to make your vision a reality. [– This is a sponsored post on behalf of Cloudinary –]

Prosper Otemuyiwa

Cloudinary provides a comprehensive cloud-based image and video management solution. With offices in Israel, London and Sunnyvale, Calif., Cloudinary has quickly become the de facto solution used by web and mobile application developers at major companies around the world to streamline image and video management, and deliver an optimal end user experience. Among Cloudinary users are Answers​.com, Conde Nast, Gawker, Gizmodo, TED, The Knot, Under Armour, Vogue, Wired and many others. For more information, visit www​.cloudinary​.com or follow on Twitter @cloudinary.

Read Next

Apple Opts for AR over VR at WWDC

An Apple VR headset has been one of the most widely-rumored devices of the last few years, and it was finally settled a…

Exciting New Tools for Designers, June 2023

We’re halfway through 2023 already, and the number of incredible apps, tools, and resources for designers is mounting.

3 Essential Design Trends, June 2023

This month we are focusing on three trends within a bigger website design trend – different navigation menu styles and …

15 Best New Fonts, May 2023

The choices you make when selecting a typeface have more impact on your design than almost any other decision, so it’s …

10+ Best Tools & Resources for Web Designers and Agencies (2023 updated)

Having the ability to envision a tastefully designed website (i.e., the role creativity plays) is important. But being …

20 Best New Websites, May 2023

This month, there are tons of great new agency websites to get excited about. 3D animated prisms are a popular theme, a…

How to Find the Right White Label Website Builder for Your Agency

Web design agencies face a lot of obstacles in closing the deal with new clients. One of the most common ones is the ar…

Exciting New Tools For Designers, May 2023

There are hundreds of new tools for designers and developers released each month. We sift through them all to bring you…

3 Essential Design Trends, May 2023

All three of the website design trends here mimic something bigger going on in the tech space, from a desire to have mo…

10 Best AI Tools for Web Designers (2023)

It’s time to stop worrying if AI is going to take your job and instead start using AI to expand the services you can of…

10 Best Marketing Agency Websites (Examples, Inspo, and Templates!)

Marketers are skilled in developing strategies, producing visual assets, writing text with high impact, and optimizing …

15 Best New Fonts, April 2023

Fonts are a designer’s best friend. They add personality to our designs and enable fine typography to elevate the quali…