Cloudinary Blog

Image transformation recipes in the cloud. The Cloudinary Cookbook

Image transformation 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 transformations - 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 transformations correctly to solve a problem or achieve a certain effect?

Cloudinary is a cloud-based image management service that lets you file upload your website's images to the cloud, and perform a large variety of image transformations on them. Our customers frequently share with us new, exciting and occasionally surprising results achieved by mixing and matching from Cloudinary's image transformation 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 transformations, or tweaking a specific transformation 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 transformations put together. But note that some of our examples include advanced transformations 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 transformation 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 transformations on-the-fly in the cloud, using a dynamic URL that specifies exactly how the image should be modified. You can provide this image transformation 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 transformation URL with a single line of code.

Cookbook recipes

Each recipe snippet includes an example of an image transformation 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 transformation examples, code samples, and more details on how the transformations 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 transformation (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 transformation 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 transformation ingredients that we provide. In addition, we kept expanding our transformation 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 transformation 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

Our $2B Valuation

By
Blackstone Growth Invests in Cloudinary

When we started our journey in 2012, we were looking to improve our lives as developers by making it easier for us to handle the arduous tasks of handling images and videos in our code. That initial line of developer code has evolved into a full suite of media experience solutions driven by a mission that gradually revealed itself over the course of the past 10 years: help companies unleash the full potential of their media to create the most engaging visual experiences.

Read more
Direct-to-Consumer E-Commerce Requires Compelling Visual Experiences

When brands like you adopt a direct–to-consumer (DTC) e-commerce approach with no involvement of retailers or marketplaces, you gain direct and timely insight into evolving shopping behaviors. Accordingly, you can accommodate shoppers’ preferences by continually adjusting your product offering and interspersing the shopping journey with moments of excitement and intrigue. Opportunities abound for you to cultivate engaging customer relationships.

Read more
Automatically Translating Videos for an International Audience

No matter your business focus—public service, B2B integration, recruitment—multimedia, in particular video, is remarkably effective in communicating with the audience. Before, making video accessible to diverse viewers involved tasks galore, such as eliciting the service of production studios to manually dub, transcribe, and add subtitles. Those operations were costly and slow, especially for globally destined content.

Read more
Cloudinary Helps Minted Manage Its Image-Generation Pipeline at Scale

Shoppers return time and again to Minted’s global online community of independent artists and designers because they know they can count on unique, statement-making products of the highest quality there. Concurrently, the visual imagery on Minted.com must do justice to the designs into which the creators have poured their hearts and souls. For Minted’s VP of Engineering David Lien, “Because we are a premium brand, we need to ensure that every single one of our product images matches the selected configuration exactly. For example, if you pick an 18x24 art print on blue canvas, we will show that exact combination on the hero images in the PDF.”

Read more
Highlights on ImageCon 2021 and a Preview of ImageCon 2022

New year, same trend! Visual media will continue to play a monumental role in driving online conversions. To keep up with visual-experience trends and best practices, Cloudinary holds an annual conference called ImageCon, a one-of-a-kind event that helps attendees create the most engaging visual experiences possible.

Read more