Cloudinary Blog

Happy New Year and a hat trick

Happy New Year and a hat trick

As the end of 2015 approaches, we wanted to share a quick summary of Cloudinary’s accomplishment this year and some of our plans for next year. We couldn't possibly do this without including an image manipulation example! That's our hat trick in the title :-)

Looking back at 2015

2015 was a great year for Cloudinary. We more than doubled our numbers, including our team size, offices, customers and revenues. During 2015 we’ve hit another significant milestone, crossing the eight-figures in annual run rate.

In 2015 we also released exciting new features and capabilities that our users have asked us for. Here are a few highlights:

This year for the first time, we shared some behind-the-scenes technical details and numbers. This post explains Cloudinary's bootstrapped way of organically building a profitable SaaS service. During 2015 we were also honored to add BVP (Bessemer Venture Partners) as a strategic investor. Cloudinary is BVP's 100th investment in cloud companies.

And now for a fun hat trick with image manipulations

Using Cloudinary you can add overlays on top of underlying images using image manipulation URLs. You can further control the look & feel of the overlays by applying multiple image transformations on them. Furthermore, you can use face detection and even eye detection for placing the overlays exactly above faces or other facial attributes (using the Advanced Facial Attributes Detection add-on). That covers everything needed to dynamically add hats to all the photos on your website or mobile application!

For example, let's take the following images that were uploaded to Cloudinary (thanks to our beloved Orly B.).

Orly Bogler's profile picture

Santa hat

The dynamic image manipulation URL below adds the Santa hat exactly above the auto detected eyes while rotating the hat to perfectly match Orly’s face. The hat is dynamically resized and padded in order to fit well as an actual hat.

Ruby:
cl_image_tag("profile_orly_bogler.jpg", :transformation=>[
  {:overlay=>"santa_hat", :effect=>"trim"},
  {:gravity=>"north_east", :width=>1.0, :height=>2.45, :crop=>"lpad"},
  {:gravity=>"adv_eyes", :flags=>["region_relative", "layer_apply"], :width=>2.8, :crop=>"scale"}
  ])
PHP:
cl_image_tag("profile_orly_bogler.jpg", array("transformation"=>array(
  array("overlay"=>"santa_hat", "effect"=>"trim"),
  array("gravity"=>"north_east", "width"=>1.0, "height"=>2.45, "crop"=>"lpad"),
  array("gravity"=>"adv_eyes", "flags"=>array("region_relative", "layer_apply"), "width"=>2.8, "crop"=>"scale")
  )))
Python:
CloudinaryImage("profile_orly_bogler.jpg").image(transformation=[
  {"overlay": "santa_hat", "effect": "trim"},
  {"gravity": "north_east", "width": 1.0, "height": 2.45, "crop": "lpad"},
  {"gravity": "adv_eyes", "flags": ["region_relative", "layer_apply"], "width": 2.8, "crop": "scale"}
  ])
Node.js:
cloudinary.image("profile_orly_bogler.jpg", {transformation: [
  {overlay: "santa_hat", effect: "trim"},
  {gravity: "north_east", width: "1.0", height: "2.45", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "2.8", crop: "scale"}
  ]})
Java:
cloudinary.url().transformation(new Transformation()
  .overlay("santa_hat").effect("trim").chain()
  .gravity("north_east").width(1.0).height(2.45).crop("lpad").chain()
  .gravity("adv_eyes").flags("region_relative", "layer_apply").width(2.8).crop("scale")).imageTag("profile_orly_bogler.jpg")
JS:
cl.imageTag('profile_orly_bogler.jpg', {transformation: [
  {overlay: "santa_hat", effect: "trim"},
  {gravity: "north_east", width: "1.0", height: "2.45", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "2.8", crop: "scale"}
  ]}).toHtml();
jQuery:
$.cloudinary.image("profile_orly_bogler.jpg", {transformation: [
  {overlay: "santa_hat", effect: "trim"},
  {gravity: "north_east", width: "1.0", height: "2.45", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "2.8", crop: "scale"}
  ]})
React:
<Image publicId="profile_orly_bogler.jpg" >
  <Transformation overlay="santa_hat" effect="trim" />
  <Transformation gravity="north_east" width="1.0" height="2.45" crop="lpad" />
  <Transformation gravity="adv_eyes" flags={["region_relative", "layer_apply"]} width="2.8" crop="scale" />
</Image>
Angular:
<cl-image public-id="profile_orly_bogler.jpg" >
  <cl-transformation overlay="santa_hat" effect="trim">
  </cl-transformation>
  <cl-transformation gravity="north_east" width="1.0" height="2.45" crop="lpad">
  </cl-transformation>
  <cl-transformation gravity="adv_eyes" flags={{["region_relative", "layer_apply"]}} width="2.8" crop="scale">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay("santa_hat").Effect("trim").Chain()
  .Gravity("north_east").Width(1.0).Height(2.45).Crop("lpad").Chain()
  .Gravity("adv_eyes").Flags("region_relative", "layer_apply").Width(2.8).Crop("scale")).BuildImageTag("profile_orly_bogler.jpg")
Android:
MediaManager.get().url().transformation(new Transformation()
  .overlay("santa_hat").effect("trim").chain()
  .gravity("north_east").width(1.0).height(2.45).crop("lpad").chain()
  .gravity("adv_eyes").flags("region_relative", "layer_apply").width(2.8).crop("scale")).generate("profile_orly_bogler.jpg")
Dynamic santa hat overlay using on-the-fly manipulation URL

An even more powerful capability is to add the same hat overlay to all the faces automatically detected in a photo. You may notice the different dimensions and rotation angles of each hat overlay that are automatically determined according to the detected position of the eyes. The example below uses similar image transformation instructions to add Santa hats to a group of Cloudinary's team taken at the AWS re:Invent conference.

Ruby:
cl_image_tag("cloudinary_team.jpg", :transformation=>[
  {:overlay=>"santa_hat", :effect=>"trim"},
  {:gravity=>"north_east", :width=>1.0, :height=>2.3, :crop=>"lpad"},
  {:gravity=>"adv_eyes", :flags=>["region_relative", "layer_apply"], :width=>2.6, :crop=>"scale"}
  ])
PHP:
cl_image_tag("cloudinary_team.jpg", array("transformation"=>array(
  array("overlay"=>"santa_hat", "effect"=>"trim"),
  array("gravity"=>"north_east", "width"=>1.0, "height"=>2.3, "crop"=>"lpad"),
  array("gravity"=>"adv_eyes", "flags"=>array("region_relative", "layer_apply"), "width"=>2.6, "crop"=>"scale")
  )))
Python:
CloudinaryImage("cloudinary_team.jpg").image(transformation=[
  {"overlay": "santa_hat", "effect": "trim"},
  {"gravity": "north_east", "width": 1.0, "height": 2.3, "crop": "lpad"},
  {"gravity": "adv_eyes", "flags": ["region_relative", "layer_apply"], "width": 2.6, "crop": "scale"}
  ])
Node.js:
cloudinary.image("cloudinary_team.jpg", {transformation: [
  {overlay: "santa_hat", effect: "trim"},
  {gravity: "north_east", width: "1.0", height: "2.3", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "2.6", crop: "scale"}
  ]})
Java:
cloudinary.url().transformation(new Transformation()
  .overlay("santa_hat").effect("trim").chain()
  .gravity("north_east").width(1.0).height(2.3).crop("lpad").chain()
  .gravity("adv_eyes").flags("region_relative", "layer_apply").width(2.6).crop("scale")).imageTag("cloudinary_team.jpg")
JS:
cl.imageTag('cloudinary_team.jpg', {transformation: [
  {overlay: "santa_hat", effect: "trim"},
  {gravity: "north_east", width: "1.0", height: "2.3", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "2.6", crop: "scale"}
  ]}).toHtml();
jQuery:
$.cloudinary.image("cloudinary_team.jpg", {transformation: [
  {overlay: "santa_hat", effect: "trim"},
  {gravity: "north_east", width: "1.0", height: "2.3", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "2.6", crop: "scale"}
  ]})
React:
<Image publicId="cloudinary_team.jpg" >
  <Transformation overlay="santa_hat" effect="trim" />
  <Transformation gravity="north_east" width="1.0" height="2.3" crop="lpad" />
  <Transformation gravity="adv_eyes" flags={["region_relative", "layer_apply"]} width="2.6" crop="scale" />
</Image>
Angular:
<cl-image public-id="cloudinary_team.jpg" >
  <cl-transformation overlay="santa_hat" effect="trim">
  </cl-transformation>
  <cl-transformation gravity="north_east" width="1.0" height="2.3" crop="lpad">
  </cl-transformation>
  <cl-transformation gravity="adv_eyes" flags={{["region_relative", "layer_apply"]}} width="2.6" crop="scale">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay("santa_hat").Effect("trim").Chain()
  .Gravity("north_east").Width(1.0).Height(2.3).Crop("lpad").Chain()
  .Gravity("adv_eyes").Flags("region_relative", "layer_apply").Width(2.6).Crop("scale")).BuildImageTag("cloudinary_team.jpg")
Android:
MediaManager.get().url().transformation(new Transformation()
  .overlay("santa_hat").effect("trim").chain()
  .gravity("north_east").width(1.0).height(2.3).crop("lpad").chain()
  .gravity("adv_eyes").flags("region_relative", "layer_apply").width(2.6).crop("scale")).generate("cloudinary_team.jpg")
Dynamic santa hat overlay on top of multiple automatically detected heads

As Christmas was last week, I guess a different hat is needed. The example below uses the same technique, specifying the ID of a party_hat instead of a santa_hat. This should better fit the upcoming New Year celebration.

Ruby:
cl_image_tag("cloudinary_team.jpg", :transformation=>[
  {:overlay=>"party_hat", :effect=>"trim"},
  {:width=>1.4, :height=>1.0, :crop=>"scale"},
  {:gravity=>"north_east", :width=>1.0, :height=>2.3, :crop=>"lpad"},
  {:gravity=>"adv_eyes", :flags=>["region_relative", "layer_apply"], :width=>3.0, :crop=>"scale"}
  ])
PHP:
cl_image_tag("cloudinary_team.jpg", array("transformation"=>array(
  array("overlay"=>"party_hat", "effect"=>"trim"),
  array("width"=>1.4, "height"=>1.0, "crop"=>"scale"),
  array("gravity"=>"north_east", "width"=>1.0, "height"=>2.3, "crop"=>"lpad"),
  array("gravity"=>"adv_eyes", "flags"=>array("region_relative", "layer_apply"), "width"=>3.0, "crop"=>"scale")
  )))
Python:
CloudinaryImage("cloudinary_team.jpg").image(transformation=[
  {"overlay": "party_hat", "effect": "trim"},
  {"width": 1.4, "height": 1.0, "crop": "scale"},
  {"gravity": "north_east", "width": 1.0, "height": 2.3, "crop": "lpad"},
  {"gravity": "adv_eyes", "flags": ["region_relative", "layer_apply"], "width": 3.0, "crop": "scale"}
  ])
Node.js:
cloudinary.image("cloudinary_team.jpg", {transformation: [
  {overlay: "party_hat", effect: "trim"},
  {width: "1.4", height: "1.0", crop: "scale"},
  {gravity: "north_east", width: "1.0", height: "2.3", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "3.0", crop: "scale"}
  ]})
Java:
cloudinary.url().transformation(new Transformation()
  .overlay("party_hat").effect("trim").chain()
  .width(1.4).height(1.0).crop("scale").chain()
  .gravity("north_east").width(1.0).height(2.3).crop("lpad").chain()
  .gravity("adv_eyes").flags("region_relative", "layer_apply").width(3.0).crop("scale")).imageTag("cloudinary_team.jpg")
JS:
cl.imageTag('cloudinary_team.jpg', {transformation: [
  {overlay: "party_hat", effect: "trim"},
  {width: "1.4", height: "1.0", crop: "scale"},
  {gravity: "north_east", width: "1.0", height: "2.3", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "3.0", crop: "scale"}
  ]}).toHtml();
jQuery:
$.cloudinary.image("cloudinary_team.jpg", {transformation: [
  {overlay: "party_hat", effect: "trim"},
  {width: "1.4", height: "1.0", crop: "scale"},
  {gravity: "north_east", width: "1.0", height: "2.3", crop: "lpad"},
  {gravity: "adv_eyes", flags: ["region_relative", "layer_apply"], width: "3.0", crop: "scale"}
  ]})
React:
<Image publicId="cloudinary_team.jpg" >
  <Transformation overlay="party_hat" effect="trim" />
  <Transformation width="1.4" height="1.0" crop="scale" />
  <Transformation gravity="north_east" width="1.0" height="2.3" crop="lpad" />
  <Transformation gravity="adv_eyes" flags={["region_relative", "layer_apply"]} width="3.0" crop="scale" />
</Image>
Angular:
<cl-image public-id="cloudinary_team.jpg" >
  <cl-transformation overlay="party_hat" effect="trim">
  </cl-transformation>
  <cl-transformation width="1.4" height="1.0" crop="scale">
  </cl-transformation>
  <cl-transformation gravity="north_east" width="1.0" height="2.3" crop="lpad">
  </cl-transformation>
  <cl-transformation gravity="adv_eyes" flags={{["region_relative", "layer_apply"]}} width="3.0" crop="scale">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay("party_hat").Effect("trim").Chain()
  .Width(1.4).Height(1.0).Crop("scale").Chain()
  .Gravity("north_east").Width(1.0).Height(2.3).Crop("lpad").Chain()
  .Gravity("adv_eyes").Flags("region_relative", "layer_apply").Width(3.0).Crop("scale")).BuildImageTag("cloudinary_team.jpg")
Android:
MediaManager.get().url().transformation(new Transformation()
  .overlay("party_hat").effect("trim").chain()
  .width(1.4).height(1.0).crop("scale").chain()
  .gravity("north_east").width(1.0).height(2.3).crop("lpad").chain()
  .gravity("adv_eyes").flags("region_relative", "layer_apply").width(3.0).crop("scale")).generate("cloudinary_team.jpg")
New-year party hat dynamically add to all detected people in the photo

Wouldn’t this be cool to try out on all of your websites’ photos for a single day? :-)

What's next?

We’re expecting to double our team size again in 2016, so we’ll be able to both tackle all the exciting new features and products on our road-map and continue to offer our customers the best service possible.

In 2016, Cloudinary will continue to help solve the Responsive Images challenges. We’ll take our video management solution to the next level, further enhance Cloudinary's DAM solution and media search capabilities, enhance our online Media Library and strengthen integrations with existing and new development frameworks. We’ll also be adding plenty more image and video manipulation & optimization capabilities.

Ever since we launched Cloudinary over 3.5 years ago, our customers’ needs were always our #1 priority. Keeping this in mind, the majority of the features we’ve added in 2015 were in a response to customer requests, so please keep the suggestions coming!

Happy New Year!

Recent Blog Posts

Analyze and auto tag images with Amazon Rekognition

Knowledge is power. And if you allow your users to upload images, you also probably want to better understand what their images contain. Whether a photo is of a building, people, animals, celebrities, or a product, image processing and analysis can assist in further comprehension. The benefits of this knowledge can go beyond "merely" categorizing your content and making your image library searchable: drawing insights from user generated content can be very useful! What better way to learn more about your users than to analyze the images they upload and find out what they care about and then have the ability to display relevant content to them according to their interests or even match them with other users that share similar interests.

Read more
Automatically moderate your user uploaded images

Allowing your users to upload their own images to your website can increase user engagement, retention and monetization. However, allowing your users to upload any image they want to, may lead to some of your users uploading inappropriate images to your application. These images may offend other users or even cause your site to violate standards or regulations.

Read more
Cloudinary Uses Scale API to Focus on Image Compression

Here at Cloudinary, we provide a cloud-based tool that enables our users to compress images and video for their websites and apps. Our goal is to preserve the visual integrity of the content, but deliver the smallest file size to any device or browser to ultimately optimize website performance and end user satisfaction.

Read more
CloudinaryAndroid SDK

Developing applications for mobile consumption requires facing, and overcoming, some difficult challenges. Apps need to limit their RAM, CPU and battery usage while still performing the required tasks in a reasonable time frame. If too many background tasks are running, the mobile device can become sluggish, with the battery running out very quickly. Coordination with other apps is crucial to keep the device responsive and make the battery last longer.

Read more
forLoop: Nigeria Event on Building for The Next Billion Users

TL;DR

Since Google shared their intent for the next billion internet users, some African developers thought this was pointing right at them and they needed to act fast. The mission to bring the next billion users from Africa to the internet kicked off a storm of enthusiasm. This community event turned into a success story and this is a summary of what happened.

Read more