Creating a Bevel effect

Add the Bevel effect to any image. We will create a generalized transformation URL, which could be used to apply the bevel effect to any image. In order to do this, we'll make use of variables, overlays, the colorize effect, the cut-out effect, and more. Here is the final result -

The Bevel effect

Before we start - We will make use of the following image during this tutorial, and therefore, it should be uploaded to Cloudinary in advance.
We've set its public ID to triangle -

Triangle Image

Let's begin! As a first step, we'll define some variables that we will use multiple times throughout the transformation (You can find more information about using variables here). The first one is the bevel width we'd like to apply, which we named bw, and assign it a value of 20px. In addition, we have set the img variable to be the public ID of the image we're manipulating (the base image - current:public_id) - $img_current:public_id,$bw_20. In this step, we've initialized the variables and prepared the grounds for the transformation, and it has no apparent effect on the image.

Next, we'll create the four bevels - one for each of the image edges. Each bevel is essentially made of a crop of the relevant edge of the image, with the width of bw, and the length of the edge. In addition, we'll colorize the bevel in order to give it a sense of 3D depth. Additional details regarding the colorize effect can be found here.

Let's start with the top edge and the bottom one.

Top and bottom

The top bevel is placed on the north side of the image (g_north) and we have colorized it to white, with a color strength of 30 - l_$img,c_crop,w_w,h_$bw,g_north,e_colorize:30,co_white/fl_layer_apply,g_north

Ruby:
Copy to clipboard
cl_image_tag("sample.jpg", :variables=>[["$img", "current:public_id"], ["$bw", "20"]], :transformation=>[
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"north", :effect=>"colorize:30", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"north"}
  ])
PHP:
Copy to clipboard
cl_image_tag("sample.jpg", array("variables"=>array("$img"=>"current:public_id", "$bw"=>"20"), "transformation"=>array(
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"north", "effect"=>"colorize:30", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"north")
  )))
Python:
Copy to clipboard
CloudinaryImage("sample.jpg").image(variables={"$img": "current:public_id", "$bw": "20"}, transformation=[
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "north", 'effect': "colorize:30", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "north"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: "%24img", width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north")).imageTag("sample.jpg");
JS:
Copy to clipboard
cloudinary.imageTag('sample.jpg', {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"}
  ]})
React:
Copy to clipboard
<Image publicId="sample.jpg" >
  <Transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="north" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="sample.jpg" >
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="north" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("north").Effect("colorize:30").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("north")).BuildImageTag("sample.jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north")).generate("sample.jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("north").setEffect("colorize:30").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("north")).generate("sample.jpg")!, cloudinary: cloudinary)
Top Bevel

A few words about the above transformation -

  1. You can notice the usage of the layer_apply flag, which clearly defines where a layer definition ends. This will become crucial in the left and right bevels, where we'll apply nested layers. You can read more about this flag here.
  2. The first occurrence of g_north is in charge of cropping the top edge when creating the layer, while the second occurrence of it (within the layer_apply section) is in charge of placing the layer at the top of the image.
  3. Notice that we want to crop the entire top edge, therefore, we chose to crop the full width of the image - w_w, and a hight of the bevel width - h_$bw.

The bottom bevel is placed on the south side of the image (g_south) and we have colorized it to black, with a strength of 50 - l_$img,c_crop,w_w,h_$bw,g_south,e_colorize:50,co_black/fl_layer_apply,g_south

Ruby:
Copy to clipboard
cl_image_tag("sample.jpg", :variables=>[["$img", "current:public_id"], ["$bw", "20"]], :transformation=>[
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"north", :effect=>"colorize:30", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"north"},
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"south", :effect=>"colorize:50", :color=>"black", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"south"}
  ])
PHP:
Copy to clipboard
cl_image_tag("sample.jpg", array("variables"=>array("$img"=>"current:public_id", "$bw"=>"20"), "transformation"=>array(
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"north", "effect"=>"colorize:30", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"north"),
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"south", "effect"=>"colorize:50", "color"=>"black", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"south")
  )))
Python:
Copy to clipboard
CloudinaryImage("sample.jpg").image(variables={"$img": "current:public_id", "$bw": "20"}, transformation=[
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "north", 'effect': "colorize:30", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "north"},
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "south", 'effect': "colorize:50", 'color': "black", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "south"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: "%24img", width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: "%24img", width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south")).imageTag("sample.jpg");
JS:
Copy to clipboard
cloudinary.imageTag('sample.jpg', {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"}
  ]})
React:
Copy to clipboard
<Image publicId="sample.jpg" >
  <Transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="north" />
  <Transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <Transformation flags="layer_apply" gravity="south" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="sample.jpg" >
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="north" />
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="south" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="south">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("north").Effect("colorize:30").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("north").Chain()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("south").Effect("colorize:50").Color("black").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("south")).BuildImageTag("sample.jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south")).generate("sample.jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("north").setEffect("colorize:30").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("north").chain()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("south").setEffect("colorize:50").setColor("black").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("south")).generate("sample.jpg")!, cloudinary: cloudinary)
Bottom Bevel

Left and right

Since both the left and the right bevels are created in the same manner, we'll focus on the left bevel. Let's begin by adding the bevel, the same way it is done in the top and bottom bevels - l_$img,c_crop,h_h,w_$bw,g_west,e_colorize:15,co_white/fl_layer_apply,g_west

Ruby:
Copy to clipboard
cl_image_tag("sample.jpg", :variables=>[["$img", "current:public_id"], ["$bw", "20"]], :transformation=>[
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"north", :effect=>"colorize:30", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"north"},
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"south", :effect=>"colorize:50", :color=>"black", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"south"},
  {:overlay=>"%24img", :height=>"h", :width=>"$bw", :gravity=>"west", :effect=>"colorize:15", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"west"}
  ])
PHP:
Copy to clipboard
cl_image_tag("sample.jpg", array("variables"=>array("$img"=>"current:public_id", "$bw"=>"20"), "transformation"=>array(
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"north", "effect"=>"colorize:30", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"north"),
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"south", "effect"=>"colorize:50", "color"=>"black", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"south"),
  array("overlay"=>"%24img", "height"=>"h", "width"=>"$bw", "gravity"=>"west", "effect"=>"colorize:15", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"west")
  )))
Python:
Copy to clipboard
CloudinaryImage("sample.jpg").image(variables={"$img": "current:public_id", "$bw": "20"}, transformation=[
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "north", 'effect': "colorize:30", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "north"},
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "south", 'effect': "colorize:50", 'color': "black", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "south"},
  {'overlay': "%24img", 'height': "h", 'width': "$bw", 'gravity': "west", 'effect': "colorize:15", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "west"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: "%24img", width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: "%24img", width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: "%24img", height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "west"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("west")).imageTag("sample.jpg");
JS:
Copy to clipboard
cloudinary.imageTag('sample.jpg', {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "west"}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "west"}
  ]})
React:
Copy to clipboard
<Image publicId="sample.jpg" >
  <Transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="north" />
  <Transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <Transformation flags="layer_apply" gravity="south" />
  <Transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="west" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="sample.jpg" >
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="north" />
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="south" />
  <cld-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="west" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="south">
  </cl-transformation>
  <cl-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="west">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("north").Effect("colorize:30").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("north").Chain()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("south").Effect("colorize:50").Color("black").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("south").Chain()
  .Overlay(new Layer().PublicId("%24img")).Height("h").Width("$bw").Gravity("west").Effect("colorize:15").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("west")).BuildImageTag("sample.jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("west")).generate("sample.jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("north").setEffect("colorize:30").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("north").chain()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("south").setEffect("colorize:50").setColor("black").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("south").chain()
  .setOverlay("%24img").setHeight("h").setWidth("$bw").setGravity("west").setEffect("colorize:15").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("west")).generate("sample.jpg")!, cloudinary: cloudinary)
Left Bevel - step 1

The cut-out effect, which we'll use next, is given a template image, and it trims the underlying layer wherever opaque pixels of the template are present (you can read more about the effect here). We'll make use of the cut-out effect, with the help of the triangle image as a template, in order to diagonally trim the top part of the layer. We'll do this by nesting a layer inside of the left bevel layer - l_$img,c_crop,h_h,w_$bw,g_west,e_colorize:15,co_white/l_triangle,w_$bw,a_-90/e_cut_out,fl_layer_apply,g_north_west/fl_layer_apply,g_west

Ruby:
Copy to clipboard
cl_image_tag("sample.jpg", :variables=>[["$img", "current:public_id"], ["$bw", "20"]], :transformation=>[
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"north", :effect=>"colorize:30", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"north"},
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"south", :effect=>"colorize:50", :color=>"black", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"south"},
  {:overlay=>"%24img", :height=>"h", :width=>"$bw", :gravity=>"west", :effect=>"colorize:15", :color=>"white", :crop=>"crop"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>-90},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"north_west"},
  {:flags=>"layer_apply", :gravity=>"west"}
  ])
PHP:
Copy to clipboard
cl_image_tag("sample.jpg", array("variables"=>array("$img"=>"current:public_id", "$bw"=>"20"), "transformation"=>array(
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"north", "effect"=>"colorize:30", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"north"),
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"south", "effect"=>"colorize:50", "color"=>"black", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"south"),
  array("overlay"=>"%24img", "height"=>"h", "width"=>"$bw", "gravity"=>"west", "effect"=>"colorize:15", "color"=>"white", "crop"=>"crop"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>-90),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"north_west"),
  array("flags"=>"layer_apply", "gravity"=>"west")
  )))
Python:
Copy to clipboard
CloudinaryImage("sample.jpg").image(variables={"$img": "current:public_id", "$bw": "20"}, transformation=[
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "north", 'effect': "colorize:30", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "north"},
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "south", 'effect': "colorize:50", 'color': "black", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "south"},
  {'overlay': "%24img", 'height': "h", 'width': "$bw", 'gravity': "west", 'effect': "colorize:15", 'color': "white", 'crop': "crop"},
  {'overlay': "triangle", 'width': "$bw", 'angle': -90},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "north_west"},
  {'flags': "layer_apply", 'gravity': "west"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: "%24img", width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: "%24img", width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: "%24img", height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: "triangle", width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {flags: "layer_apply", gravity: "west"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .flags("layer_apply").gravity("west")).imageTag("sample.jpg");
JS:
Copy to clipboard
cloudinary.imageTag('sample.jpg', {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {flags: "layer_apply", gravity: "west"}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {flags: "layer_apply", gravity: "west"}
  ]})
React:
Copy to clipboard
<Image publicId="sample.jpg" >
  <Transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="north" />
  <Transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <Transformation flags="layer_apply" gravity="south" />
  <Transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <Transformation overlay="triangle" width="$bw" angle="-90" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <Transformation flags="layer_apply" gravity="west" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="sample.jpg" >
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="north" />
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="south" />
  <cld-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <cld-transformation overlay="triangle" width="$bw" angle="-90" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <cld-transformation flags="layer_apply" gravity="west" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="south">
  </cl-transformation>
  <cl-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="-90">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="north_west">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="west">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("north").Effect("colorize:30").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("north").Chain()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("south").Effect("colorize:50").Color("black").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("south").Chain()
  .Overlay(new Layer().PublicId("%24img")).Height("h").Width("$bw").Gravity("west").Effect("colorize:15").Color("white").Crop("crop").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(-90).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("north_west").Chain()
  .Flags("layer_apply").Gravity("west")).BuildImageTag("sample.jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .flags("layer_apply").gravity("west")).generate("sample.jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("north").setEffect("colorize:30").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("north").chain()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("south").setEffect("colorize:50").setColor("black").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("south").chain()
  .setOverlay("%24img").setHeight("h").setWidth("$bw").setGravity("west").setEffect("colorize:15").setColor("white").setCrop("crop").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(-90).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("north_west").chain()
  .setFlags("layer_apply").setGravity("west")).generate("sample.jpg")!, cloudinary: cloudinary)
Left Bevel - step 2 - top

Notice, that we rotated the triangle image (a_-90) in order to cut out the desired part of the layer.
Below is a zoom of the top left corner, which demonstrates the effect of the above two steps -

before->after effect on the top-left corner

We will now use the cut-out effect in order to trim the bottom part of the layer -

Ruby:
Copy to clipboard
cl_image_tag("sample.jpg", :variables=>[["$img", "current:public_id"], ["$bw", "20"]], :transformation=>[
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"north", :effect=>"colorize:30", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"north"},
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"south", :effect=>"colorize:50", :color=>"black", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"south"},
  {:overlay=>"%24img", :height=>"h", :width=>"$bw", :gravity=>"west", :effect=>"colorize:15", :color=>"white", :crop=>"crop"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>-90},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"north_west"},
  {:overlay=>"triangle", :width=>"$bw"},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"south_west"},
  {:flags=>"layer_apply", :gravity=>"west"}
  ])
PHP:
Copy to clipboard
cl_image_tag("sample.jpg", array("variables"=>array("$img"=>"current:public_id", "$bw"=>"20"), "transformation"=>array(
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"north", "effect"=>"colorize:30", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"north"),
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"south", "effect"=>"colorize:50", "color"=>"black", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"south"),
  array("overlay"=>"%24img", "height"=>"h", "width"=>"$bw", "gravity"=>"west", "effect"=>"colorize:15", "color"=>"white", "crop"=>"crop"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>-90),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"north_west"),
  array("overlay"=>"triangle", "width"=>"$bw"),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"south_west"),
  array("flags"=>"layer_apply", "gravity"=>"west")
  )))
Python:
Copy to clipboard
CloudinaryImage("sample.jpg").image(variables={"$img": "current:public_id", "$bw": "20"}, transformation=[
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "north", 'effect': "colorize:30", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "north"},
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "south", 'effect': "colorize:50", 'color': "black", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "south"},
  {'overlay': "%24img", 'height': "h", 'width': "$bw", 'gravity': "west", 'effect': "colorize:15", 'color': "white", 'crop': "crop"},
  {'overlay': "triangle", 'width': "$bw", 'angle': -90},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "north_west"},
  {'overlay': "triangle", 'width': "$bw"},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "south_west"},
  {'flags': "layer_apply", 'gravity': "west"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: "%24img", width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: "%24img", width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: "%24img", height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: "triangle", width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: "triangle", width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").chain()
  .effect("cut_out").flags("layer_apply").gravity("south_west").chain()
  .flags("layer_apply").gravity("west")).imageTag("sample.jpg");
JS:
Copy to clipboard
cloudinary.imageTag('sample.jpg', {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"}
  ]})
React:
Copy to clipboard
<Image publicId="sample.jpg" >
  <Transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="north" />
  <Transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <Transformation flags="layer_apply" gravity="south" />
  <Transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <Transformation overlay="triangle" width="$bw" angle="-90" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <Transformation overlay="triangle" width="$bw" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="south_west" />
  <Transformation flags="layer_apply" gravity="west" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="sample.jpg" >
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="north" />
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="south" />
  <cld-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <cld-transformation overlay="triangle" width="$bw" angle="-90" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <cld-transformation overlay="triangle" width="$bw" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="south_west" />
  <cld-transformation flags="layer_apply" gravity="west" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="south">
  </cl-transformation>
  <cl-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="-90">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="north_west">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="south_west">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="west">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("north").Effect("colorize:30").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("north").Chain()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("south").Effect("colorize:50").Color("black").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("south").Chain()
  .Overlay(new Layer().PublicId("%24img")).Height("h").Width("$bw").Gravity("west").Effect("colorize:15").Color("white").Crop("crop").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(-90).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("north_west").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("south_west").Chain()
  .Flags("layer_apply").Gravity("west")).BuildImageTag("sample.jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").chain()
  .effect("cut_out").flags("layer_apply").gravity("south_west").chain()
  .flags("layer_apply").gravity("west")).generate("sample.jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("north").setEffect("colorize:30").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("north").chain()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("south").setEffect("colorize:50").setColor("black").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("south").chain()
  .setOverlay("%24img").setHeight("h").setWidth("$bw").setGravity("west").setEffect("colorize:15").setColor("white").setCrop("crop").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(-90).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("north_west").chain()
  .setOverlay("triangle").setWidth("$bw").chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("south_west").chain()
  .setFlags("layer_apply").setGravity("west")).generate("sample.jpg")!, cloudinary: cloudinary)
Left Bevel - step 2 - bottom

The right bevel is created in the same manner as the left one, with the bevel being added to the right edge, and trimmed with the cut-out effect at the top and the bottom -

Ruby:
Copy to clipboard
cl_image_tag("sample.jpg", :variables=>[["$img", "current:public_id"], ["$bw", "20"]], :transformation=>[
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"north", :effect=>"colorize:30", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"north"},
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"south", :effect=>"colorize:50", :color=>"black", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"south"},
  {:overlay=>"%24img", :height=>"h", :width=>"$bw", :gravity=>"west", :effect=>"colorize:15", :color=>"white", :crop=>"crop"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>-90},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"north_west"},
  {:overlay=>"triangle", :width=>"$bw"},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"south_west"},
  {:flags=>"layer_apply", :gravity=>"west"},
  {:overlay=>"%24img", :height=>"h", :width=>"$bw", :gravity=>"east", :effect=>"colorize:30", :color=>"black", :crop=>"crop"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>180},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"north_east"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>90},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"south_east"},
  {:flags=>"layer_apply", :gravity=>"east"}
  ])
PHP:
Copy to clipboard
cl_image_tag("sample.jpg", array("variables"=>array("$img"=>"current:public_id", "$bw"=>"20"), "transformation"=>array(
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"north", "effect"=>"colorize:30", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"north"),
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"south", "effect"=>"colorize:50", "color"=>"black", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"south"),
  array("overlay"=>"%24img", "height"=>"h", "width"=>"$bw", "gravity"=>"west", "effect"=>"colorize:15", "color"=>"white", "crop"=>"crop"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>-90),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"north_west"),
  array("overlay"=>"triangle", "width"=>"$bw"),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"south_west"),
  array("flags"=>"layer_apply", "gravity"=>"west"),
  array("overlay"=>"%24img", "height"=>"h", "width"=>"$bw", "gravity"=>"east", "effect"=>"colorize:30", "color"=>"black", "crop"=>"crop"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>180),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"north_east"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>90),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"south_east"),
  array("flags"=>"layer_apply", "gravity"=>"east")
  )))
Python:
Copy to clipboard
CloudinaryImage("sample.jpg").image(variables={"$img": "current:public_id", "$bw": "20"}, transformation=[
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "north", 'effect': "colorize:30", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "north"},
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "south", 'effect': "colorize:50", 'color': "black", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "south"},
  {'overlay': "%24img", 'height': "h", 'width': "$bw", 'gravity': "west", 'effect': "colorize:15", 'color': "white", 'crop': "crop"},
  {'overlay': "triangle", 'width': "$bw", 'angle': -90},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "north_west"},
  {'overlay': "triangle", 'width': "$bw"},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "south_west"},
  {'flags': "layer_apply", 'gravity': "west"},
  {'overlay': "%24img", 'height': "h", 'width': "$bw", 'gravity': "east", 'effect': "colorize:30", 'color': "black", 'crop': "crop"},
  {'overlay': "triangle", 'width': "$bw", 'angle': 180},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "north_east"},
  {'overlay': "triangle", 'width': "$bw", 'angle': 90},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "south_east"},
  {'flags': "layer_apply", 'gravity': "east"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: "%24img", width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: "%24img", width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: "%24img", height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: "triangle", width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: "triangle", width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"},
  {overlay: "%24img", height: "h", width: "$bw", gravity: "east", effect: "colorize:30", color: "black", crop: "crop"},
  {overlay: "triangle", width: "$bw", angle: 180},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_east"},
  {overlay: "triangle", width: "$bw", angle: 90},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_east"},
  {flags: "layer_apply", gravity: "east"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").chain()
  .effect("cut_out").flags("layer_apply").gravity("south_west").chain()
  .flags("layer_apply").gravity("west").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("east").effect("colorize:30").color("black").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(180).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_east").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(90).chain()
  .effect("cut_out").flags("layer_apply").gravity("south_east").chain()
  .flags("layer_apply").gravity("east")).imageTag("sample.jpg");
JS:
Copy to clipboard
cloudinary.imageTag('sample.jpg', {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "east", effect: "colorize:30", color: "black", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 180},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_east"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 90},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_east"},
  {flags: "layer_apply", gravity: "east"}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("sample.jpg", {variables: [["$img", "current:public_id"], ["$bw", "20"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "east", effect: "colorize:30", color: "black", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 180},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_east"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 90},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_east"},
  {flags: "layer_apply", gravity: "east"}
  ]})
React:
Copy to clipboard
<Image publicId="sample.jpg" >
  <Transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="north" />
  <Transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <Transformation flags="layer_apply" gravity="south" />
  <Transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <Transformation overlay="triangle" width="$bw" angle="-90" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <Transformation overlay="triangle" width="$bw" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="south_west" />
  <Transformation flags="layer_apply" gravity="west" />
  <Transformation overlay="%24img" height="h" width="$bw" gravity="east" effect="colorize:30" color="black" crop="crop" />
  <Transformation overlay="triangle" width="$bw" angle="180" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="north_east" />
  <Transformation overlay="triangle" width="$bw" angle="90" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="south_east" />
  <Transformation flags="layer_apply" gravity="east" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="sample.jpg" >
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="north" />
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="south" />
  <cld-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <cld-transformation overlay="triangle" width="$bw" angle="-90" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <cld-transformation overlay="triangle" width="$bw" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="south_west" />
  <cld-transformation flags="layer_apply" gravity="west" />
  <cld-transformation overlay="%24img" height="h" width="$bw" gravity="east" effect="colorize:30" color="black" crop="crop" />
  <cld-transformation overlay="triangle" width="$bw" angle="180" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="north_east" />
  <cld-transformation overlay="triangle" width="$bw" angle="90" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="south_east" />
  <cld-transformation flags="layer_apply" gravity="east" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="south">
  </cl-transformation>
  <cl-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="-90">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="north_west">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="south_west">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="west">
  </cl-transformation>
  <cl-transformation overlay="%24img" height="h" width="$bw" gravity="east" effect="colorize:30" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="180">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="north_east">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="90">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="south_east">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="east">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("north").Effect("colorize:30").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("north").Chain()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("south").Effect("colorize:50").Color("black").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("south").Chain()
  .Overlay(new Layer().PublicId("%24img")).Height("h").Width("$bw").Gravity("west").Effect("colorize:15").Color("white").Crop("crop").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(-90).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("north_west").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("south_west").Chain()
  .Flags("layer_apply").Gravity("west").Chain()
  .Overlay(new Layer().PublicId("%24img")).Height("h").Width("$bw").Gravity("east").Effect("colorize:30").Color("black").Crop("crop").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(180).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("north_east").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(90).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("south_east").Chain()
  .Flags("layer_apply").Gravity("east")).BuildImageTag("sample.jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","20")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").chain()
  .effect("cut_out").flags("layer_apply").gravity("south_west").chain()
  .flags("layer_apply").gravity("west").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("east").effect("colorize:30").color("black").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(180).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_east").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(90).chain()
  .effect("cut_out").flags("layer_apply").gravity("south_east").chain()
  .flags("layer_apply").gravity("east")).generate("sample.jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("north").setEffect("colorize:30").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("north").chain()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("south").setEffect("colorize:50").setColor("black").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("south").chain()
  .setOverlay("%24img").setHeight("h").setWidth("$bw").setGravity("west").setEffect("colorize:15").setColor("white").setCrop("crop").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(-90).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("north_west").chain()
  .setOverlay("triangle").setWidth("$bw").chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("south_west").chain()
  .setFlags("layer_apply").setGravity("west").chain()
  .setOverlay("%24img").setHeight("h").setWidth("$bw").setGravity("east").setEffect("colorize:30").setColor("black").setCrop("crop").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(180).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("north_east").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(90).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("south_east").chain()
  .setFlags("layer_apply").setGravity("east")).generate("sample.jpg")!, cloudinary: cloudinary)
Right Bevel

Done! We now have the bevel effect applied. You can finetune it as you'd like -

  • Change the bevel width by assigning different values to the bw variable.
  • Change the "light" direction, by changing the strengths of the colorize effect.
  • Since we used variables, and generalized the transformation, you could apply the exact same transformation to other images, by simply replacing the public ID.

For example -

Ruby:
Copy to clipboard
cl_image_tag("three-dogs.jpg", :variables=>[["$img", "current:public_id"], ["$bw", "120"]], :transformation=>[
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"north", :effect=>"colorize:30", :color=>"white", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"north"},
  {:overlay=>"%24img", :width=>"w", :height=>"$bw", :gravity=>"south", :effect=>"colorize:50", :color=>"black", :crop=>"crop"},
  {:flags=>"layer_apply", :gravity=>"south"},
  {:overlay=>"%24img", :height=>"h", :width=>"$bw", :gravity=>"west", :effect=>"colorize:15", :color=>"white", :crop=>"crop"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>-90},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"north_west"},
  {:overlay=>"triangle", :width=>"$bw"},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"south_west"},
  {:flags=>"layer_apply", :gravity=>"west"},
  {:overlay=>"%24img", :height=>"h", :width=>"$bw", :gravity=>"east", :effect=>"colorize:30", :color=>"black", :crop=>"crop"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>180},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"north_east"},
  {:overlay=>"triangle", :width=>"$bw", :angle=>90},
  {:effect=>"cut_out", :flags=>"layer_apply", :gravity=>"south_east"},
  {:flags=>"layer_apply", :gravity=>"east"}
  ])
PHP:
Copy to clipboard
cl_image_tag("three-dogs.jpg", array("variables"=>array("$img"=>"current:public_id", "$bw"=>"120"), "transformation"=>array(
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"north", "effect"=>"colorize:30", "color"=>"white", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"north"),
  array("overlay"=>"%24img", "width"=>"w", "height"=>"$bw", "gravity"=>"south", "effect"=>"colorize:50", "color"=>"black", "crop"=>"crop"),
  array("flags"=>"layer_apply", "gravity"=>"south"),
  array("overlay"=>"%24img", "height"=>"h", "width"=>"$bw", "gravity"=>"west", "effect"=>"colorize:15", "color"=>"white", "crop"=>"crop"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>-90),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"north_west"),
  array("overlay"=>"triangle", "width"=>"$bw"),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"south_west"),
  array("flags"=>"layer_apply", "gravity"=>"west"),
  array("overlay"=>"%24img", "height"=>"h", "width"=>"$bw", "gravity"=>"east", "effect"=>"colorize:30", "color"=>"black", "crop"=>"crop"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>180),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"north_east"),
  array("overlay"=>"triangle", "width"=>"$bw", "angle"=>90),
  array("effect"=>"cut_out", "flags"=>"layer_apply", "gravity"=>"south_east"),
  array("flags"=>"layer_apply", "gravity"=>"east")
  )))
Python:
Copy to clipboard
CloudinaryImage("three-dogs.jpg").image(variables={"$img": "current:public_id", "$bw": "120"}, transformation=[
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "north", 'effect': "colorize:30", 'color': "white", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "north"},
  {'overlay': "%24img", 'width': "w", 'height': "$bw", 'gravity': "south", 'effect': "colorize:50", 'color': "black", 'crop': "crop"},
  {'flags': "layer_apply", 'gravity': "south"},
  {'overlay': "%24img", 'height': "h", 'width': "$bw", 'gravity': "west", 'effect': "colorize:15", 'color': "white", 'crop': "crop"},
  {'overlay': "triangle", 'width': "$bw", 'angle': -90},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "north_west"},
  {'overlay': "triangle", 'width': "$bw"},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "south_west"},
  {'flags': "layer_apply", 'gravity': "west"},
  {'overlay': "%24img", 'height': "h", 'width': "$bw", 'gravity': "east", 'effect': "colorize:30", 'color': "black", 'crop': "crop"},
  {'overlay': "triangle", 'width': "$bw", 'angle': 180},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "north_east"},
  {'overlay': "triangle", 'width': "$bw", 'angle': 90},
  {'effect': "cut_out", 'flags': "layer_apply", 'gravity': "south_east"},
  {'flags': "layer_apply", 'gravity': "east"}
  ])
Node.js:
Copy to clipboard
cloudinary.image("three-dogs.jpg", {variables: [["$img", "current:public_id"], ["$bw", "120"]], transformation: [
  {overlay: "%24img", width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: "%24img", width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: "%24img", height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: "triangle", width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: "triangle", width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"},
  {overlay: "%24img", height: "h", width: "$bw", gravity: "east", effect: "colorize:30", color: "black", crop: "crop"},
  {overlay: "triangle", width: "$bw", angle: 180},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_east"},
  {overlay: "triangle", width: "$bw", angle: 90},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_east"},
  {flags: "layer_apply", gravity: "east"}
  ]})
Java:
Copy to clipboard
cloudinary.url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","120")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").chain()
  .effect("cut_out").flags("layer_apply").gravity("south_west").chain()
  .flags("layer_apply").gravity("west").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("east").effect("colorize:30").color("black").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(180).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_east").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(90).chain()
  .effect("cut_out").flags("layer_apply").gravity("south_east").chain()
  .flags("layer_apply").gravity("east")).imageTag("three-dogs.jpg");
JS:
Copy to clipboard
cloudinary.imageTag('three-dogs.jpg', {variables: [["$img", "current:public_id"], ["$bw", "120"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "east", effect: "colorize:30", color: "black", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 180},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_east"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 90},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_east"},
  {flags: "layer_apply", gravity: "east"}
  ]}).toHtml();
jQuery:
Copy to clipboard
$.cloudinary.image("three-dogs.jpg", {variables: [["$img", "current:public_id"], ["$bw", "120"]], transformation: [
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "north", effect: "colorize:30", color: "white", crop: "crop"},
  {flags: "layer_apply", gravity: "north"},
  {overlay: new cloudinary.Layer().publicId("%24img"), width: "w", height: "$bw", gravity: "south", effect: "colorize:50", color: "black", crop: "crop"},
  {flags: "layer_apply", gravity: "south"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "west", effect: "colorize:15", color: "white", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: -90},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_west"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw"},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_west"},
  {flags: "layer_apply", gravity: "west"},
  {overlay: new cloudinary.Layer().publicId("%24img"), height: "h", width: "$bw", gravity: "east", effect: "colorize:30", color: "black", crop: "crop"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 180},
  {effect: "cut_out", flags: "layer_apply", gravity: "north_east"},
  {overlay: new cloudinary.Layer().publicId("triangle"), width: "$bw", angle: 90},
  {effect: "cut_out", flags: "layer_apply", gravity: "south_east"},
  {flags: "layer_apply", gravity: "east"}
  ]})
React:
Copy to clipboard
<Image publicId="three-dogs.jpg" >
  <Transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <Transformation flags="layer_apply" gravity="north" />
  <Transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <Transformation flags="layer_apply" gravity="south" />
  <Transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <Transformation overlay="triangle" width="$bw" angle="-90" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <Transformation overlay="triangle" width="$bw" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="south_west" />
  <Transformation flags="layer_apply" gravity="west" />
  <Transformation overlay="%24img" height="h" width="$bw" gravity="east" effect="colorize:30" color="black" crop="crop" />
  <Transformation overlay="triangle" width="$bw" angle="180" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="north_east" />
  <Transformation overlay="triangle" width="$bw" angle="90" />
  <Transformation effect="cut_out" flags="layer_apply" gravity="south_east" />
  <Transformation flags="layer_apply" gravity="east" />
</Image>
Vue.js:
Copy to clipboard
<cld-image publicId="three-dogs.jpg" >
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="north" />
  <cld-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop" />
  <cld-transformation flags="layer_apply" gravity="south" />
  <cld-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop" />
  <cld-transformation overlay="triangle" width="$bw" angle="-90" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="north_west" />
  <cld-transformation overlay="triangle" width="$bw" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="south_west" />
  <cld-transformation flags="layer_apply" gravity="west" />
  <cld-transformation overlay="%24img" height="h" width="$bw" gravity="east" effect="colorize:30" color="black" crop="crop" />
  <cld-transformation overlay="triangle" width="$bw" angle="180" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="north_east" />
  <cld-transformation overlay="triangle" width="$bw" angle="90" />
  <cld-transformation effect="cut_out" flags="layer_apply" gravity="south_east" />
  <cld-transformation flags="layer_apply" gravity="east" />
</cld-image>
Angular:
Copy to clipboard
<cl-image public-id="three-dogs.jpg" >
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="north" effect="colorize:30" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="north">
  </cl-transformation>
  <cl-transformation overlay="%24img" width="w" height="$bw" gravity="south" effect="colorize:50" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="south">
  </cl-transformation>
  <cl-transformation overlay="%24img" height="h" width="$bw" gravity="west" effect="colorize:15" color="white" crop="crop">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="-90">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="north_west">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="south_west">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="west">
  </cl-transformation>
  <cl-transformation overlay="%24img" height="h" width="$bw" gravity="east" effect="colorize:30" color="black" crop="crop">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="180">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="north_east">
  </cl-transformation>
  <cl-transformation overlay="triangle" width="$bw" angle="90">
  </cl-transformation>
  <cl-transformation effect="cut_out" flags="layer_apply" gravity="south_east">
  </cl-transformation>
  <cl-transformation flags="layer_apply" gravity="east">
  </cl-transformation>
</cl-image>
.Net:
Copy to clipboard
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("north").Effect("colorize:30").Color("white").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("north").Chain()
  .Overlay(new Layer().PublicId("%24img")).Width("w").Height("$bw").Gravity("south").Effect("colorize:50").Color("black").Crop("crop").Chain()
  .Flags("layer_apply").Gravity("south").Chain()
  .Overlay(new Layer().PublicId("%24img")).Height("h").Width("$bw").Gravity("west").Effect("colorize:15").Color("white").Crop("crop").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(-90).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("north_west").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("south_west").Chain()
  .Flags("layer_apply").Gravity("west").Chain()
  .Overlay(new Layer().PublicId("%24img")).Height("h").Width("$bw").Gravity("east").Effect("colorize:30").Color("black").Crop("crop").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(180).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("north_east").Chain()
  .Overlay(new Layer().PublicId("triangle")).Width("$bw").Angle(90).Chain()
  .Effect("cut_out").Flags("layer_apply").Gravity("south_east").Chain()
  .Flags("layer_apply").Gravity("east")).BuildImageTag("three-dogs.jpg")
Android:
Copy to clipboard
MediaManager.get().url().transformation(new Transformation()
.variables(variable("$img","current:public_id"),variable("$bw","120")).chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("north").effect("colorize:30").color("white").crop("crop").chain()
  .flags("layer_apply").gravity("north").chain()
  .overlay(new Layer().publicId("%24img")).width("w").height("$bw").gravity("south").effect("colorize:50").color("black").crop("crop").chain()
  .flags("layer_apply").gravity("south").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("west").effect("colorize:15").color("white").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(-90).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_west").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").chain()
  .effect("cut_out").flags("layer_apply").gravity("south_west").chain()
  .flags("layer_apply").gravity("west").chain()
  .overlay(new Layer().publicId("%24img")).height("h").width("$bw").gravity("east").effect("colorize:30").color("black").crop("crop").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(180).chain()
  .effect("cut_out").flags("layer_apply").gravity("north_east").chain()
  .overlay(new Layer().publicId("triangle")).width("$bw").angle(90).chain()
  .effect("cut_out").flags("layer_apply").gravity("south_east").chain()
  .flags("layer_apply").gravity("east")).generate("three-dogs.jpg");
iOS:
Copy to clipboard
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("north").setEffect("colorize:30").setColor("white").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("north").chain()
  .setOverlay("%24img").setWidth("w").setHeight("$bw").setGravity("south").setEffect("colorize:50").setColor("black").setCrop("crop").chain()
  .setFlags("layer_apply").setGravity("south").chain()
  .setOverlay("%24img").setHeight("h").setWidth("$bw").setGravity("west").setEffect("colorize:15").setColor("white").setCrop("crop").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(-90).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("north_west").chain()
  .setOverlay("triangle").setWidth("$bw").chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("south_west").chain()
  .setFlags("layer_apply").setGravity("west").chain()
  .setOverlay("%24img").setHeight("h").setWidth("$bw").setGravity("east").setEffect("colorize:30").setColor("black").setCrop("crop").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(180).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("north_east").chain()
  .setOverlay("triangle").setWidth("$bw").setAngle(90).chain()
  .setEffect("cut_out").setFlags("layer_apply").setGravity("south_east").chain()
  .setFlags("layer_apply").setGravity("east")).generate("three-dogs.jpg")!, cloudinary: cloudinary)
Finetuned Bevel to three-dogs