Cloudinary Blog

Image manipulation recipes in the cloud. The Cloudinary Cookbook

Image manipulation recipes in the cloud

How do you crop an image to a custom shape? How do you add a shadow effect to an image with transparency? How do you add text overlay to an image without using HTML?

If you build or maintain a website with a lot of images, you've probably had many questions like these. Most developers who work with images have scripts or tools that can achieve dozens if not hundreds of image manipulations - from basics like crop and resize, to advanced stuff like shadow and transparency, watermarks, face detection, etc. But how do you mix and match these manipulations correctly to solve a problem or achieve a certain effect?

Cloudinary is a cloud-based image management service that lets you upload your website's images to the cloud, and perform a large variety of image manipulations on them. Our customers frequently share with us new, exciting and occasionally surprising results achieved by mixing and matching from Cloudinary's image manipulation toolset. We wanted to share these experiences with you, in the form of the Cloudinary Cookbook.

The Cloudinary Cookbook is a collection of examples showing how to do complex things with images, by combining different image manipulations, or tweaking a specific manipulation to achieve a certain result. The cookbook is built of recipes that include sample images, code in all development frameworks, tips and guidelines and links to additional resources.

For those who don't yet use Cloudinary, our Cookbook should provide some inspiration about cool things you can achieve with just a few image manipulations put together. But note that some of our examples include advanced manipulations that are unique to Cloudinary :) For new or existing users, the cookbook will be a way to learn from others' experiences or from the Cloudinary team's knowledge, and achieve cool effects much faster, with code samples you can copy-paste (with minor changes) into your software project.

Using the Cookbook - Cloudinary's collection of image manipulation examples

The Cloudinary Cookbook is available here:

Our cookbook consists of recipes. The most popular ones are listed in the main page, which you can see in the screenshot below. Each recipe is assigned with one or more tags; click a tag to browse recipes by subject. On the main page or tag pages you can see snippets of recipes with thumbnails of some of the example images, a short description and the code that generates the image effect.

Cloudinary does image manipulations on-the-fly in the cloud, using a dynamic URL that specifies exactly how the image should be modified. You can provide this image manipulation URL directly, or use our client libraries for Ruby on Rails, PHP, Python/Django, Node.js, Java, .Net or jQuery, to construct the required image manipulation URL with a single line of code.

Cookbook recipes

Each recipe snippet includes an example of an image manipulation URL that could generate this image, and code samples that show how to build this URL with the transformation parameters that need to be applied. Click on the tabs of the framework names to view the sample code for the development framework you use.

Cookbook recipe snippet

Clicking on a recipe snippet leads you to the full recipe page. As you can see below, in the full page, larger images are displayed, there are additional image manipulation examples, code samples, and more details on how the manipulations work.

You can comment on each specific recipe, like it on Facebook or share it on Twitter or Google+, and also add your comment in the thread at the bottom of the page.

Cookbook recipe page

We're working on adding many more recipes, most of them requested or suggested by our users. We already have a few dozen recipes available, including cropping image to a custom shape, face-detection based image cropping, using images as text textures, adding watermarks as overlay images, add shadow effect to an image, auto-generating a photo collage and more.

Summary

Cloudinary's service is not just about image manipulation (we also provide cloud storage of images, optimized delivery via CDN, image administration and management), but it’s a key component of our service. Our image manipulation capabilities are rich and always expanding. You can resize and crop images based on face detection, rotate photos, add overlays and watermarks, add text layers, adjust colors, apply effects and filters, chain multiple transformations, and much more.

Since Cloudinary's service was publicly launched more than two years ago, our customers kept surprising us with an impressive set of results they generated using the image manipulation ingredients that we provide. In addition, we kept expanding our manipulation capabilities according to the requests of many of our customers. The new Cloudinary Cookbook is the place for Cloudinary users to share the results they've been generating with our cloud-based image manipulation features.

We have big plans for the Cookbook - we're already working on dozens of additional recipes, and are encouraging our users to share their cool recipes with the community and to vote on recipes of other users. Do you have a tried-and-tested recipe of your own? Contact us, let us know and we'll be happy to add it to the Cookbook.

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