Cloudinary Blog

Cloud-based API for applying effects on images

If you Google for “Hello Cloudinary”, you will find some intriguing articles claiming that Cloudinary is a Photoshop replacement. Well, although the comparison is very flattering and we do believe that Cloudinary is a fantastic service for web developers, we never thought of our service as a replacement for Photoshop. However, some image manipulation features of Cloudinary allow web developers and web designers to dynamically modify the look & feel of their website’s images in an extremely easy way without manually processing their images using an image editing desktop software. In this blog post we wanted to describe some of Cloudinary’s newest features - applying effects and filters on images.

Effects 

Applying effects on images is done using the new ‘effect’ parameter or ‘e’ for URLs. Some effects also accept an additional numeric parameter. Here are some examples:

Let’s take the following ‘horses’ image that was uploaded to Cloudinary:

https://res.cloudinary.com/demo/image/upload/horses.jpg

The following examples modify the color saturation of the image. A negative saturation value will reduce saturation and a positive will increase it:

.../image/upload/e_saturation:-70/horses.jpg       .../image/upload/e_saturation:70/horses.jpg

   

If you’re using Cloudinary’s client-side integration libraries, applying this transformation is made even simpler:

Ruby on Rails:

Copy to clipboard
<%= cl_image_tag("horses.jpg", :effect => "saturation:70") %>

PHP:

Copy to clipboard
<?php echo cl_image_tag("horses.jpg", array("effect" => "saturation:70")) ?>
Django:
Copy to clipboard
{% cloudinary "horses.jpg" effect="saturation:70" %}

 

With Cloudinary’s cloud-based transformations you can also change an image’s brightness

.../image/upload/e_brightness:-50/horses.jpg      .../image/upload/e_brightness:50/horses.jpg

   

 
You can also apply a sepia effect. Use either the default sepia level or set a custom level by specifying the extra numeric value:
 
 
And you can also easily convert an image to grayscale or apply an oil-paint effect:
 

 

Chained Transformations

If you read our documentation and follow our blog posts, you probably know that Cloudinary already provides many image transformations and delivery methods. By chaining these image transformations together, you can create images that perfectly complement your graphic design.

For example, the following image is Arianna Huffington’s Facebok profile picture:

Take a look at the following Cloudinary URL that generates the image below:

.../image/facebook/w_150,h_150,c_thumb,g_face,r_20,e_sepia/l_techcrunch,g_south_west,x_5,y_5,w_50/a_10/AriannaHuffington.png 

 

What happened here? Simply accessing the above URL told Cloudinary to remotely fetch Arriana Huffington’s Facebook profile picture, created a 150x150px thumbnail using face detection based cropping, rounded the image’s corners, added a sepia effect, converted it to a transparent PNG format, added a watermark layer on the bottom-left corner, rotated the image by 10 degrees clock-wise and ultimately delivered the resulting image through a fast CDN using smart caching techniques. Isn’t that great?

Same example in Ruby on Rails:

Copy to clipboard
<%= facebook_profile_image_tag("AriannaHuffington.png", :angle => 10, 
        :transformation => 
          [{:width => 150, :height => 150, :crop => :thumb, 
            :gravity => :face, :radius => 20, :effect => :sepia},
           {:overlay => "techcrunch", :gravity => :south_west, 
            :x => 5, :y => 5, :width => 50}]) %>

 

Tweaking a Website’s Color Scheme

Web developers and web designers often encounter a scenario in which a client sees their website and asks for just a tiny tweak to the color scheme they used. Changing colors of texts and other HTML elements can be easily done using CSS tweaks. But what about the images that construct your website’s design? With Cloudinary you no longer need to process all images to generate slightly different color variations. You can simply apply the hue change effect on all images delivered by Cloudinary. It accepts a numeric value between -100 and 100.

For example, the following is a background image used on Cloudinary’s web site.



Copy to clipboard
<img src="site_bg.jpg" width="350" height="135" data-src="site_bg.jpg" 
     class="bg_image"/>

The following URL can be used to generate a version with a slightly different hue:



The same can be achieved using Cloudinary’s client-side libraries. For example, this is how it might look like using our jQuery library:
Copy to clipboard
$('.bg_image').cloudinary({ effect: "hue:50"});

All effects and filters described above are available for all our paid and free plans. Want to try it out? Sign up to our free plan in seconds.
Please tell us what you think about the new effects. Should we support additional effects? Any other image transformation features still missing?

Recent Blog Posts

Generate Waveform Images from Audio with Cloudinary

This is a reposting of an article written by David Walsh. Check out his blog HERE!
I've been working a lot with visualizations lately, which is a far cry from your normal webpage element interaction coding; you need advanced geometry knowledge, render and performance knowledge, and much more. It's been a great learning experience but it can be challenging and isn't always an interest of all web developers. That's why we use apps and services specializing in complex tasks like Cloudinary: we need it done quickly and by a tool written by an expert.

Read more
Make All Images on Your Website Responsive in 3 Easy Steps

Images are crucial to website performance, but most still don't implement responsive images. It’s not just about fitting an image on the screen, but also making the the image size relatively rational to the device. The srcset and sizes options, which are your best hit are hard to implement. Cloudinary provides an easier way, which we will discuss in this article.

Read more

The Future of Audio and Video on the Web

By Prosper Otemuyiwa
The Future of Audio and Video on the Web

Web sites and platforms are becoming increasingly media-rich. Today, approximately 62 percent of internet traffic is made up of images, with audio and video constituting a growing percentage of the bytes.

Read more

Embed Images in Email Campaigns at Scale

By Sourav Kundu
Embed Images in Email Campaigns at Scale

tl;dr

Cloudinary is a powerful image hosting solution for email marketing campaigns of any size. With features such as advanced image optimization and on-the-fly image transformation, backed by a global CDN, Cloudinary provides the base for a seamless user experience in your email campaigns leading to increased conversion and performance.

Read more
Build the Back-End For Your Own Instagram-style App with Cloudinary

Github Repo

Managing media files (processing, storage and manipulation) is one of the biggest challenges we encounter as practical developers. These challenges include:

A great service called Cloudinary can help us overcome many of these challenges. Together with Cloudinary, let's work on solutions to these challenges and hopefully have a simpler mental model towards media management.

Read more

Build A Miniflix in 10 Minutes

By Prosper Otemuyiwa
Build A Miniflix in 10 Minutes

Developers are constantly faced with challenges of building complex products every single day. And there are constraints on the time needed to build out the features of these products.

Engineering and Product managers want to beat deadlines for projects daily. CEOs want to roll out new products as fast as possible. Entrepreneurs need their MVPs like yesterday. With this in mind, what should developers do?

Read more