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:

http://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:

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

PHP:

<?php echo cl_image_tag("horses.jpg", array("effect" => "saturation:70")) ?>
Django:
{% 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:

<%= 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.



<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:
$('.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

Increase engagement with on-the-fly cartoon effect

We all know that images attract interest and increase engagement, but with the huge overload of images out there, we sometimes need to get creative to stand out in the crowd. Your users who upload photos to your site or app may also be looking for those same creative opportunities. A quick look at the most popular social media apps and their continually increasing toolbox of special photo effects shows the increasing trend in popularity and demand for these fun ways of expressing one’s identity.

Read more

Lazy Loading for Optimal Performance

By Ezequiel Bruni
Lazy Loading for Performance

Who doesn't love some striking imagery to drive your point home? Whether you're selling a product or service, trying to communicate complex ideas, or simply captivate the emotions of your users, pictures can do that. Everyone knows they work, and everyone loves them.

Read more
Automating image manipulation with user-defined variables

No programmer could imagine a world without variables. Neither can Cloudinary. That’s why Cloudinary now offers image transformations that support user-defined variables.

Using Cloudinary, you can already deliver transformed images with a variety of transformations, including resizing, cropping, rotating, a huge toolbox of special effects and filters, text and image overlays, and more, all of which you can deliver responsively, on-the-fly, and optimized for quick delivery via CDN.

Read more
Authentication via cookies for session-based access control

Controlling who can access your images and videos, and when, can be an important concern for your business and security workflow. You may have resources that you only want some of your users or employees to access, or you may need to make sure that your original resources are secure, and only transformed (edited) versions of your resources are delivered, e.g., with a watermark or logo displayed.

Read more