Relative size overlays

Resize overlays to a given percentage of the main image, either related to width, height or both by setting the flags parameter to relative (fl_relative in URLs) while also setting the width and/or height parameters to the percentage value you need, represented by a decimal value (e.g., 0.4 for 40%).

Main image

Main image

100% width-related

100% width-related

Including text

Including text
Ruby:
cl_image_tag("black_bar.png")
PHP:
cl_image_tag("black_bar.png")
Python:
CloudinaryImage("black_bar.png").image()
Node.js:
cloudinary.image("black_bar.png")
Java:
cloudinary.url().imageTag("black_bar.png")
JS:
cl.imageTag('black_bar.png').toHtml();
jQuery:
$.cloudinary.image("black_bar.png")
React:
<Image publicId="black_bar.png" >

</Image>
Angular:
<cl-image public-id="black_bar.png" >

</cl-image>
.Net:
cloudinary.Api.UrlImgUp.BuildImageTag("black_bar.png")
Android:
MediaManager.get().url().generate("black_bar.png")
by Itay Taragano

Extract frames from an animated GIF

Extract frames from an animated GIF, you can choose which frame to deliver, apply any further image manipulations including resizing, cropping, overlays and much more.

Original

Original

1st frame-Default

1st frame-Default

10th frame

10th frame
Ruby:
cl_image_tag("bored_animation.jpg")
PHP:
cl_image_tag("bored_animation.jpg")
Python:
CloudinaryImage("bored_animation.jpg").image()
Node.js:
cloudinary.image("bored_animation.jpg")
Java:
cloudinary.url().imageTag("bored_animation.jpg")
JS:
cl.imageTag('bored_animation.jpg').toHtml();
jQuery:
$.cloudinary.image("bored_animation.jpg")
React:
<Image publicId="bored_animation.jpg" >

</Image>
Angular:
<cl-image public-id="bored_animation.jpg" >

</cl-image>
.Net:
cloudinary.Api.UrlImgUp.BuildImageTag("bored_animation.jpg")
Android:
MediaManager.get().url().generate("bored_animation.jpg")
by Itay Taragano

Animated GIF manipulation

Transform animated GIFs just like any other image. Use Cloudinary's powerful image transformation tools to manipulate your animated GIFs just like you do for other standard still images.

Original

Original

Rotated

Rotated

Adding text

Adding text
Ruby:
cl_image_tag("cloudinary_animation.gif", :width=>0.5, :crop=>"scale")
PHP:
cl_image_tag("cloudinary_animation.gif", array("width"=>0.5, "crop"=>"scale"))
Python:
CloudinaryImage("cloudinary_animation.gif").image(width=0.5, crop="scale")
Node.js:
cloudinary.image("cloudinary_animation.gif", {width: "0.5", crop: "scale"})
Java:
cloudinary.url().transformation(new Transformation().width(0.5).crop("scale")).imageTag("cloudinary_animation.gif")
JS:
cl.imageTag('cloudinary_animation.gif', {width: "0.5", crop: "scale"}).toHtml();
jQuery:
$.cloudinary.image("cloudinary_animation.gif", {width: "0.5", crop: "scale"})
React:
<Image publicId="cloudinary_animation.gif" >
  <Transformation width="0.5" crop="scale" />
</Image>
Angular:
<cl-image public-id="cloudinary_animation.gif" >
  <cl-transformation width="0.5" crop="scale">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(0.5).Crop("scale")).BuildImageTag("cloudinary_animation.gif")
Android:
MediaManager.get().url().transformation(new Transformation().width(0.5).crop("scale")).generate("cloudinary_animation.gif")
by Itay Taragano

Adding watermarks as an overlay

Add your watermark as an overlay on top of any image by setting the overlay parameter (l in URLs) as your watermark image's public ID. The overlaid image's size and position is customizable.

Overlaying

Overlaying

Scale and position

Scale and position

Semi-transparent

Semi-transparent
Ruby:
cl_image_tag("envelope.jpg", :overlay=>"cloudinary_icon")
PHP:
cl_image_tag("envelope.jpg", array("overlay"=>"cloudinary_icon"))
Python:
CloudinaryImage("envelope.jpg").image(overlay="cloudinary_icon")
Node.js:
cloudinary.image("envelope.jpg", {overlay: "cloudinary_icon"})
Java:
cloudinary.url().transformation(new Transformation().overlay("cloudinary_icon")).imageTag("envelope.jpg")
JS:
cl.imageTag('envelope.jpg', {overlay: "cloudinary_icon"}).toHtml();
jQuery:
$.cloudinary.image("envelope.jpg", {overlay: "cloudinary_icon"})
React:
<Image publicId="envelope.jpg" >
  <Transformation overlay="cloudinary_icon" />
</Image>
Angular:
<cl-image public-id="envelope.jpg" >
  <cl-transformation overlay="cloudinary_icon">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation().Overlay("cloudinary_icon")).BuildImageTag("envelope.jpg")
Android:
MediaManager.get().url().transformation(new Transformation().overlay("cloudinary_icon")).generate("envelope.jpg")
by Itay Taragano

Generate your photo collage online

Take your base image and use the overlay parameter (l in URLs) to add any further images. Set the required width and height (w and h in URLs) with the required crop mode, and add any further transformations, effects and texts.

Various images

Various images

Collage with text

Collage with text

Another collage

Another collage
Ruby:
cl_image_tag("yellow_tulip.jpg", :transformation=>[
  {:width=>220, :height=>140, :crop=>"fill"},
  {:overlay=>"brown_sheep", :width=>220, :height=>140, :x=>220, :crop=>"fill"},
  {:overlay=>"horses", :width=>220, :height=>140, :y=>140, :x=>-110, :crop=>"fill"},
  {:overlay=>"white_chicken", :width=>220, :height=>140, :y=>70, :x=>110, :crop=>"fill"},
  {:overlay=>"butterfly.png", :height=>200, :x=>-10, :angle=>10},
  {:width=>400, :height=>260, :radius=>20, :crop=>"crop"},
  {:overlay=>"text:Parisienne_35_bold:Memories%20from%20our%20trip", :color=>"#990C47", :y=>155},
  {:effect=>"shadow"}
  ])
PHP:
cl_image_tag("yellow_tulip.jpg", array("transformation"=>array(
  array("width"=>220, "height"=>140, "crop"=>"fill"),
  array("overlay"=>"brown_sheep", "width"=>220, "height"=>140, "x"=>220, "crop"=>"fill"),
  array("overlay"=>"horses", "width"=>220, "height"=>140, "y"=>140, "x"=>-110, "crop"=>"fill"),
  array("overlay"=>"white_chicken", "width"=>220, "height"=>140, "y"=>70, "x"=>110, "crop"=>"fill"),
  array("overlay"=>"butterfly.png", "height"=>200, "x"=>-10, "angle"=>10),
  array("width"=>400, "height"=>260, "radius"=>20, "crop"=>"crop"),
  array("overlay"=>"text:Parisienne_35_bold:Memories%20from%20our%20trip", "color"=>"#990C47", "y"=>155),
  array("effect"=>"shadow")
  )))
Python:
CloudinaryImage("yellow_tulip.jpg").image(transformation=[
  {"width": 220, "height": 140, "crop": "fill"},
  {"overlay": "brown_sheep", "width": 220, "height": 140, "x": 220, "crop": "fill"},
  {"overlay": "horses", "width": 220, "height": 140, "y": 140, "x": -110, "crop": "fill"},
  {"overlay": "white_chicken", "width": 220, "height": 140, "y": 70, "x": 110, "crop": "fill"},
  {"overlay": "butterfly.png", "height": 200, "x": -10, "angle": 10},
  {"width": 400, "height": 260, "radius": 20, "crop": "crop"},
  {"overlay": "text:Parisienne_35_bold:Memories%20from%20our%20trip", "color": "#990C47", "y": 155},
  {"effect": "shadow"}
  ])
Node.js:
cloudinary.image("yellow_tulip.jpg", {transformation: [
  {width: 220, height: 140, crop: "fill"},
  {overlay: "brown_sheep", width: 220, height: 140, x: 220, crop: "fill"},
  {overlay: "horses", width: 220, height: 140, y: 140, x: -110, crop: "fill"},
  {overlay: "white_chicken", width: 220, height: 140, y: 70, x: 110, crop: "fill"},
  {overlay: "butterfly.png", height: 200, x: -10, angle: 10},
  {width: 400, height: 260, radius: 20, crop: "crop"},
  {overlay: "text:Parisienne_35_bold:Memories%20from%20our%20trip", color: "#990C47", y: 155},
  {effect: "shadow"}
  ]})
Java:
cloudinary.url().transformation(new Transformation()
  .width(220).height(140).crop("fill").chain()
  .overlay("brown_sheep").width(220).height(140).x(220).crop("fill").chain()
  .overlay("horses").width(220).height(140).y(140).x(-110).crop("fill").chain()
  .overlay("white_chicken").width(220).height(140).y(70).x(110).crop("fill").chain()
  .overlay("butterfly.png").height(200).x(-10).angle(10).chain()
  .width(400).height(260).radius(20).crop("crop").chain()
  .overlay("text:Parisienne_35_bold:Memories%20from%20our%20trip").color("#990C47").y(155).chain()
  .effect("shadow")).imageTag("yellow_tulip.jpg")
JS:
cl.imageTag('yellow_tulip.jpg', {transformation: [
  {width: 220, height: 140, crop: "fill"},
  {overlay: "brown_sheep", width: 220, height: 140, x: 220, crop: "fill"},
  {overlay: "horses", width: 220, height: 140, y: 140, x: -110, crop: "fill"},
  {overlay: "white_chicken", width: 220, height: 140, y: 70, x: 110, crop: "fill"},
  {overlay: "butterfly.png", height: 200, x: -10, angle: 10},
  {width: 400, height: 260, radius: 20, crop: "crop"},
  {overlay: "text:Parisienne_35_bold:Memories%20from%20our%20trip", color: "#990C47", y: 155},
  {effect: "shadow"}
  ]}).toHtml();
jQuery:
$.cloudinary.image("yellow_tulip.jpg", {transformation: [
  {width: 220, height: 140, crop: "fill"},
  {overlay: "brown_sheep", width: 220, height: 140, x: 220, crop: "fill"},
  {overlay: "horses", width: 220, height: 140, y: 140, x: -110, crop: "fill"},
  {overlay: "white_chicken", width: 220, height: 140, y: 70, x: 110, crop: "fill"},
  {overlay: "butterfly.png", height: 200, x: -10, angle: 10},
  {width: 400, height: 260, radius: 20, crop: "crop"},
  {overlay: "text:Parisienne_35_bold:Memories%20from%20our%20trip", color: "#990C47", y: 155},
  {effect: "shadow"}
  ]})
React:
<Image publicId="yellow_tulip.jpg" >
  <Transformation width="220" height="140" crop="fill" />
  <Transformation overlay="brown_sheep" width="220" height="140" x="220" crop="fill" />
  <Transformation overlay="horses" width="220" height="140" y="140" x="-110" crop="fill" />
  <Transformation overlay="white_chicken" width="220" height="140" y="70" x="110" crop="fill" />
  <Transformation overlay="butterfly.png" height="200" x="-10" angle="10" />
  <Transformation width="400" height="260" radius="20" crop="crop" />
  <Transformation overlay="text:Parisienne_35_bold:Memories%20from%20our%20trip" color="#990C47" y="155" />
  <Transformation effect="shadow" />
</Image>
Angular:
<cl-image public-id="yellow_tulip.jpg" >
  <cl-transformation width="220" height="140" crop="fill">
  </cl-transformation>
  <cl-transformation overlay="brown_sheep" width="220" height="140" x="220" crop="fill">
  </cl-transformation>
  <cl-transformation overlay="horses" width="220" height="140" y="140" x="-110" crop="fill">
  </cl-transformation>
  <cl-transformation overlay="white_chicken" width="220" height="140" y="70" x="110" crop="fill">
  </cl-transformation>
  <cl-transformation overlay="butterfly.png" height="200" x="-10" angle="10">
  </cl-transformation>
  <cl-transformation width="400" height="260" radius="20" crop="crop">
  </cl-transformation>
  <cl-transformation overlay="text:Parisienne_35_bold:Memories%20from%20our%20trip" color="#990C47" y="155">
  </cl-transformation>
  <cl-transformation effect="shadow">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Width(220).Height(140).Crop("fill").Chain()
  .Overlay("brown_sheep").Width(220).Height(140).X(220).Crop("fill").Chain()
  .Overlay("horses").Width(220).Height(140).Y(140).X(-110).Crop("fill").Chain()
  .Overlay("white_chicken").Width(220).Height(140).Y(70).X(110).Crop("fill").Chain()
  .Overlay("butterfly.png").Height(200).X(-10).Angle(10).Chain()
  .Width(400).Height(260).Radius(20).Crop("crop").Chain()
  .Overlay("text:Parisienne_35_bold:Memories%20from%20our%20trip").Color("#990C47").Y(155).Chain()
  .Effect("shadow")).BuildImageTag("yellow_tulip.jpg")
Android:
MediaManager.get().url().transformation(new Transformation()
  .width(220).height(140).crop("fill").chain()
  .overlay("brown_sheep").width(220).height(140).x(220).crop("fill").chain()
  .overlay("horses").width(220).height(140).y(140).x(-110).crop("fill").chain()
  .overlay("white_chicken").width(220).height(140).y(70).x(110).crop("fill").chain()
  .overlay("butterfly.png").height(200).x(-10).angle(10).chain()
  .width(400).height(260).radius(20).crop("crop").chain()
  .overlay("text:Parisienne_35_bold:Memories%20from%20our%20trip").color("#990C47").y(155).chain()
  .effect("shadow")).generate("yellow_tulip.jpg")
by Itay Taragano

Limiting an image by specified dimensions

Limit the size of the image by specifying the width and height (w and h in URLs) while setting the crop parameter to limit. This will create an image that does not exceed the given width and height. All original image parts remain visible and the aspect ratio of the original image is kept.

Original

Original

70x70 Limited

70x70 Limited

1000x1000 Limited

1000x1000 Limited
Ruby:
cl_image_tag("cashew_chicken.jpg", :width=>70, :height=>70, :crop=>"limit")
PHP:
cl_image_tag("cashew_chicken.jpg", array("width"=>70, "height"=>70, "crop"=>"limit"))
Python:
CloudinaryImage("cashew_chicken.jpg").image(width=70, height=70, crop="limit")
Node.js:
cloudinary.image("cashew_chicken.jpg", {width: 70, height: 70, crop: "limit"})
Java:
cloudinary.url().transformation(new Transformation().width(70).height(70).crop("limit")).imageTag("cashew_chicken.jpg")
JS:
cl.imageTag('cashew_chicken.jpg', {width: 70, height: 70, crop: "limit"}).toHtml();
jQuery:
$.cloudinary.image("cashew_chicken.jpg", {width: 70, height: 70, crop: "limit"})
React:
<Image publicId="cashew_chicken.jpg" >
  <Transformation width="70" height="70" crop="limit" />
</Image>
Angular:
<cl-image public-id="cashew_chicken.jpg" >
  <cl-transformation width="70" height="70" crop="limit">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(70).Height(70).Crop("limit")).BuildImageTag("cashew_chicken.jpg")
Android:
MediaManager.get().url().transformation(new Transformation().width(70).height(70).crop("limit")).generate("cashew_chicken.jpg")
by Itay Taragano

Resizing an image to fill given dimensions

Resize your images to fill specified dimensions by setting the width and height (w and h in URLs), while setting the crop parameter to fill (c_fill in URLs). This will resize and crop the image so an image with the exact specified dimensions is generated. The fill crop mode keeps the original image's aspect ratio, therefore parts of the images may be cut-off.

Original

Original

Fill 150x300

Fill 150x300

Fill 500x150

Fill 500x150
Ruby:
cl_image_tag("boulder.jpg", :width=>150, :height=>300, :crop=>"fill")
PHP:
cl_image_tag("boulder.jpg", array("width"=>150, "height"=>300, "crop"=>"fill"))
Python:
CloudinaryImage("boulder.jpg").image(width=150, height=300, crop="fill")
Node.js:
cloudinary.image("boulder.jpg", {width: 150, height: 300, crop: "fill"})
Java:
cloudinary.url().transformation(new Transformation().width(150).height(300).crop("fill")).imageTag("boulder.jpg")
JS:
cl.imageTag('boulder.jpg', {width: 150, height: 300, crop: "fill"}).toHtml();
jQuery:
$.cloudinary.image("boulder.jpg", {width: 150, height: 300, crop: "fill"})
React:
<Image publicId="boulder.jpg" >
  <Transformation width="150" height="300" crop="fill" />
</Image>
Angular:
<cl-image public-id="boulder.jpg" >
  <cl-transformation width="150" height="300" crop="fill">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(150).Height(300).Crop("fill")).BuildImageTag("boulder.jpg")
Android:
MediaManager.get().url().transformation(new Transformation().width(150).height(300).crop("fill")).generate("boulder.jpg")
by Itay Taragano

Fitting an image within specified dimensions

To change the image size to fit in given width and height while retaining original proportions, specify the width and height parameters (w and h in URLs) while setting the crop parameter to fit (c_fit in URLs).

Original

Original

Fit 70x90

Fit 70x90

300x100 fit

300x100 fit
Ruby:
cl_image_tag("flower.jpg", :width=>70, :height=>90, :crop=>"fit")
PHP:
cl_image_tag("flower.jpg", array("width"=>70, "height"=>90, "crop"=>"fit"))
Python:
CloudinaryImage("flower.jpg").image(width=70, height=90, crop="fit")
Node.js:
cloudinary.image("flower.jpg", {width: 70, height: 90, crop: "fit"})
Java:
cloudinary.url().transformation(new Transformation().width(70).height(90).crop("fit")).imageTag("flower.jpg")
JS:
cl.imageTag('flower.jpg', {width: 70, height: 90, crop: "fit"}).toHtml();
jQuery:
$.cloudinary.image("flower.jpg", {width: 70, height: 90, crop: "fit"})
React:
<Image publicId="flower.jpg" >
  <Transformation width="70" height="90" crop="fit" />
</Image>
Angular:
<cl-image public-id="flower.jpg" >
  <cl-transformation width="70" height="90" crop="fit">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(70).Height(90).Crop("fit")).BuildImageTag("flower.jpg")
Android:
MediaManager.get().url().transformation(new Transformation().width(70).height(90).crop("fit")).generate("flower.jpg")
by Itay Taragano

Resize an image

Resize your images by setting the width and/or height parameters (w and h in URLs). When resizing using Cloudinary's URL-based transformations, Cloudinary will automatically apply the scale crop mode. Alternatively, you can use any one of our many supported crop modes.

Original

Original

Scaled

Scaled

Stretched

Stretched
Ruby:
cl_image_tag("turtles.jpg", :width=>70, :height=>53, :crop=>"scale")
PHP:
cl_image_tag("turtles.jpg", array("width"=>70, "height"=>53, "crop"=>"scale"))
Python:
CloudinaryImage("turtles.jpg").image(width=70, height=53, crop="scale")
Node.js:
cloudinary.image("turtles.jpg", {width: 70, height: 53, crop: "scale"})
Java:
cloudinary.url().transformation(new Transformation().width(70).height(53).crop("scale")).imageTag("turtles.jpg")
JS:
cl.imageTag('turtles.jpg', {width: 70, height: 53, crop: "scale"}).toHtml();
jQuery:
$.cloudinary.image("turtles.jpg", {width: 70, height: 53, crop: "scale"})
React:
<Image publicId="turtles.jpg" >
  <Transformation width="70" height="53" crop="scale" />
</Image>
Angular:
<cl-image public-id="turtles.jpg" >
  <cl-transformation width="70" height="53" crop="scale">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(70).Height(53).Crop("scale")).BuildImageTag("turtles.jpg")
Android:
MediaManager.get().url().transformation(new Transformation().width(70).height(53).crop("scale")).generate("turtles.jpg")
by Itay Taragano

Convert PDF to JPG

Convert your PDF files to a JPG thumbnail by simply switching the extension of the file to JPG. You can also specify the target thumbnail dimensions using the width and height parameters and any available crop mode. If your PDF file has multiple pages, you can specify the specific page to convert using the page parameter (pg in URLs). For example: Multi-page

PDF thumbnail

PDF thumbnail

With overlays

With overlays

Multi-page

Multi-page
Ruby:
cl_image_tag("multi_page_pdf.jpg", :width=>200, :height=>250, :page=>2, :crop=>"fill")
PHP:
cl_image_tag("multi_page_pdf.jpg", array("width"=>200, "height"=>250, "page"=>2, "crop"=>"fill"))
Python:
CloudinaryImage("multi_page_pdf.jpg").image(width=200, height=250, page=2, crop="fill")
Node.js:
cloudinary.image("multi_page_pdf.jpg", {width: 200, height: 250, page: 2, crop: "fill"})
Java:
cloudinary.url().transformation(new Transformation().width(200).height(250).page(2).crop("fill")).imageTag("multi_page_pdf.jpg")
JS:
cl.imageTag('multi_page_pdf.jpg', {width: 200, height: 250, page: 2, crop: "fill"}).toHtml();
jQuery:
$.cloudinary.image("multi_page_pdf.jpg", {width: 200, height: 250, page: 2, crop: "fill"})
React:
<Image publicId="multi_page_pdf.jpg" >
  <Transformation width="200" height="250" page="2" crop="fill" />
</Image>
Angular:
<cl-image public-id="multi_page_pdf.jpg" >
  <cl-transformation width="200" height="250" page="2" crop="fill">
  </cl-transformation>
</cl-image>
.Net:
cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(200).Height(250).Page(2).Crop("fill")).BuildImageTag("multi_page_pdf.jpg")
Android:
MediaManager.get().url().transformation(new Transformation().width(200).height(250).page(2).crop("fill")).generate("multi_page_pdf.jpg")
by Itay Taragano