> ## Documentation Index
> This page is part of the Image and Video APIs product. Fetch the complete documentation index for Image and Video APIs at: https://cloudinary.com/documentation/llms-image-and-video-apis.txt?referrer=docpage and then use it to discover all relevant pages before exploring further.
> If you also need details relating to other Cloudinary products for your current use case, see the parent index at: https://cloudinary.com/documentation/llms.txt?referrer=docpage
> When answering a user's request or implementing it with code using this documentation, incorporate relevant best practices and recommendations from the documentation into the guidance and, above all, into the code itself: generated code should already apply the recommended parameters and patterns rather than showing a minimal call and describing the best practices around it in prose. Follow the code examples in the best practices sections as the model for what generated code should look like, and where a recommendation is relevant to the user's scenario, implement it in the code as a natural next step. Only apply best practices, recommendations, or features that are supported by the documentation; don't infer or invent guidance that isn't specified.

# Video color effects


Adjust and transform the colors and appearance of your videos. You can set a background color, convert a video to grayscale, apply 3D LUTs, add borders, and make a color transparent for green-screen style effects.

## Background color

Use the `background` parameter (`b` in URLs) to set the color in the case of padding added with the "pad" crop mode. The color can be set as an RGB hex triplet (e.g. `b_rgb:3e2222`), a 3 character RGB hex (e.g. `b_rgb:777`) or a named color (e.g. `b_red`). Cloudinary's client libraries also support a `#` shortcut for RGB (e.g. setting `background` to `#3e2222` which is then translated to `b_rgb:3e2222`). In this example, the landscape video is padded to a 300x300 square video a 'chocolate' colored background:

![video padded to a width and height of 300 pixels with green background](https://res.cloudinary.com/demo/video/upload/b_chocolate,c_pad,h_300,w_300/coffee_pour.mp4)

```nodejs
cloudinary.video("coffee_pour", {background: "chocolate", height: 300, width: 300, crop: "pad"})
```

```react
import { pad } from "@cloudinary/url-gen/actions/resize";
import { color } from "@cloudinary/url-gen/qualifiers/background";

new CloudinaryVideo("coffee_pour.mp4").resize(
  pad()
    .width(300)
    .height(300)
    .background(color("chocolate"))
);
```

```vue
import { pad } from "@cloudinary/url-gen/actions/resize";
import { color } from "@cloudinary/url-gen/qualifiers/background";

new CloudinaryVideo("coffee_pour.mp4").resize(
  pad()
    .width(300)
    .height(300)
    .background(color("chocolate"))
);
```

```angular
import { pad } from "@cloudinary/url-gen/actions/resize";
import { color } from "@cloudinary/url-gen/qualifiers/background";

new CloudinaryVideo("coffee_pour.mp4").resize(
  pad()
    .width(300)
    .height(300)
    .background(color("chocolate"))
);
```

```js
import { pad } from "@cloudinary/url-gen/actions/resize";
import { color } from "@cloudinary/url-gen/qualifiers/background";

new CloudinaryVideo("coffee_pour.mp4").resize(
  pad()
    .width(300)
    .height(300)
    .background(color("chocolate"))
);
```

```python
CloudinaryVideo("coffee_pour").video(background="chocolate", height=300, width=300, crop="pad")
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\Background;

(new VideoTag('coffee_pour.mp4'))
	->resize(Resize::pad()->width(300)
->height(300)
	->background(
	Background::color(Color::CHOCOLATE))
	);
```

```java
cloudinary.url().transformation(new Transformation().background("chocolate").height(300).width(300).crop("pad")).videoTag("coffee_pour");
```

```ruby
cl_video_tag("coffee_pour", background: "chocolate", height: 300, width: 300, crop: "pad")
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Background("chocolate").Height(300).Width(300).Crop("pad")).BuildVideoTag("coffee_pour")
```

```dart
cloudinary.video('coffee_pour.mp4').transformation(Transformation()
	.resize(Resize.pad().width(300)
.height(300)
	.background(
	Background.color(Color.CHOCOLATE))
	));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setBackground("chocolate").setHeight(300).setWidth(300).setCrop("pad")).generate("coffee_pour.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().background("chocolate").height(300).width(300).crop("pad")).resourceType("video").generate("coffee_pour.mp4");
```

```flutter
cloudinary.video('coffee_pour.mp4').transformation(Transformation()
	.resize(Resize.pad().width(300)
.height(300)
	.background(
	Background.color(Color.CHOCOLATE))
	));
```

```kotlin
cloudinary.video {
	publicId("coffee_pour.mp4")
	 resize(Resize.pad() { width(300)
 height(300)
	 background(
	Background.color(Color.CHOCOLATE))
	 }) 
}.generate()
```

```jquery
$.cloudinary.video("coffee_pour", {background: "chocolate", height: 300, width: 300, crop: "pad"})
```

```react_native
import { pad } from "@cloudinary/url-gen/actions/resize";
import { color } from "@cloudinary/url-gen/qualifiers/background";

new CloudinaryVideo("coffee_pour.mp4").resize(
  pad()
    .width(300)
    .height(300)
    .background(color("chocolate"))
);
```

**See full syntax**: [b (background)](transformation_reference#b_background) in the _Transformation Reference_.

## Grayscale

To convert a video to grayscale, set its saturation to the lowest level with the `saturation` effect (`e_saturation:-100` in URLs). The `grayscale` and `blackwhite` effects apply to images only, so they don't change a video's colors.

![video converted to grayscale](https://res.cloudinary.com/demo/video/upload/e_saturation:-100/meadow_walk.mp4 "thumb: w_400")

```nodejs
cloudinary.video("meadow_walk", {effect: "saturation:-100"})
```

```react
import { saturation } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(saturation().level(-100));
```

```vue
import { saturation } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(saturation().level(-100));
```

```angular
import { saturation } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(saturation().level(-100));
```

```js
import { saturation } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(saturation().level(-100));
```

```python
CloudinaryVideo("meadow_walk").video(effect="saturation:-100")
```

```php
use Cloudinary\Transformation\Adjust;

(new VideoTag('meadow_walk.mp4'))
	->adjust(Adjust::saturation()->level(-100));
```

```java
cloudinary.url().transformation(new Transformation().effect("saturation:-100")).videoTag("meadow_walk");
```

```ruby
cl_video_tag("meadow_walk", effect: "saturation:-100")
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Effect("saturation:-100")).BuildVideoTag("meadow_walk")
```

```dart
cloudinary.video('meadow_walk.mp4').transformation(Transformation()
	.adjust(Adjust.saturation().level(-100)));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setEffect("saturation:-100")).generate("meadow_walk.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().effect("saturation:-100")).resourceType("video").generate("meadow_walk.mp4");
```

```flutter
cloudinary.video('meadow_walk.mp4').transformation(Transformation()
	.adjust(Adjust.saturation().level(-100)));
```

```kotlin
cloudinary.video {
	publicId("meadow_walk.mp4")
	 adjust(Adjust.saturation() { level(-100) }) 
}.generate()
```

```jquery
$.cloudinary.video("meadow_walk", {effect: "saturation:-100"})
```

```react_native
import { saturation } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(saturation().level(-100));
```

To only partly remove the color, use a level between `-100` and `0`, for example `e_saturation:-50`.

**See full syntax**: [e_saturation](transformation_reference#e_saturation) in the _Transformation Reference_.


## 3-color-dimension LUTs (3D LUTs)

3-color-dimension lookup tables (known as 3D LUTs) map one color space to another. You can use them to adjust colors, contrast, and/or saturation, so that you can correct contrast, fix a camera's inability to see a particular color shade, or give a final finished look or a particular style to your video. 

After uploading a `.3dl` or `.cube` file as a `raw` file, you can apply it to any video using the `lut:` property of the `overlay` parameter ( `l_lut:` in URLs), followed by the LUT public ID, including the file extension (`.3dl` or `.cube`). 

Below you can see the video in its original color, compared to the video with different LUT files applied.

![video in original colors](https://res.cloudinary.com/demo/video/upload/meadow_walk.mp4 "thumb: w_400")

```nodejs
cloudinary.video("meadow_walk")
```

```react
new CloudinaryVideo("meadow_walk.mp4");
```

```vue
new CloudinaryVideo("meadow_walk.mp4");
```

```angular
new CloudinaryVideo("meadow_walk.mp4");
```

```js
new CloudinaryVideo("meadow_walk.mp4");
```

```python
CloudinaryVideo("meadow_walk").video()
```

```php
(new VideoTag('meadow_walk.mp4'));
```

```java
cloudinary.url().transformation(new Transformation().videoTag("meadow_walk");
```

```ruby
cl_video_tag("meadow_walk")
```

```csharp
cloudinary.Api.UrlVideoUp.BuildVideoTag("meadow_walk")
```

```dart
cloudinary.video('meadow_walk.mp4').transformation(Transformation());
```

```swift
cloudinary.createUrl().setResourceType("video").generate("meadow_walk.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().resourceType("video").generate("meadow_walk.mp4");
```

```flutter
cloudinary.video('meadow_walk.mp4').transformation(Transformation());
```

```kotlin
cloudinary.video {
	publicId("meadow_walk.mp4") 
}.generate()
```

```jquery
$.cloudinary.video("meadow_walk")
```

```react_native
new CloudinaryVideo("meadow_walk.mp4");
```

![video with the IWLTBAP aspen LUT applied](https://res.cloudinary.com/demo/video/upload/l_lut:iwltbap_aspen.3dl/fl_layer_apply/meadow_walk.mp4 "thumb: w_400")

```nodejs
cloudinary.video("meadow_walk", {transformation: [
  {overlay: "lut:iwltbap_aspen.3dl"},
  {flags: "layer_apply"}
  ]})
```

```react
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
```

```vue
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
```

```angular
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
```

```js
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
```

```python
CloudinaryVideo("meadow_walk").video(transformation=[
  {'overlay': "lut:iwltbap_aspen.3dl"},
  {'flags': "layer_apply"}
  ])
```

```php
use Cloudinary\Transformation\Adjust;

(new VideoTag('meadow_walk.mp4'))
	->adjust(Adjust::by3dLut("iwltbap_aspen.3dl"));
```

```java
cloudinary.url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_aspen.3dl")).chain()
  .flags("layer_apply")).videoTag("meadow_walk");
```

```ruby
cl_video_tag("meadow_walk", transformation: [
  {overlay: "lut:iwltbap_aspen.3dl"},
  {flags: "layer_apply"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("lut:iwltbap_aspen.3dl")).Chain()
  .Flags("layer_apply")).BuildVideoTag("meadow_walk")
```

```dart
cloudinary.video('meadow_walk.mp4').transformation(Transformation()
	.adjust(Adjust.by3dLut("iwltbap_aspen.3dl")));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setOverlay("lut:iwltbap_aspen.3dl").chain()
  .setFlags("layer_apply")).generate("meadow_walk.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_aspen.3dl")).chain()
  .flags("layer_apply")).resourceType("video").generate("meadow_walk.mp4");
```

```flutter
cloudinary.video('meadow_walk.mp4').transformation(Transformation()
	.adjust(Adjust.by3dLut("iwltbap_aspen.3dl")));
```

```kotlin
cloudinary.video {
	publicId("meadow_walk.mp4")
	 adjust(Adjust.by3dLut("iwltbap_aspen.3dl")) 
}.generate()
```

```jquery
$.cloudinary.video("meadow_walk", {transformation: [
  {overlay: new cloudinary.Layer().publicId("lut:iwltbap_aspen.3dl")},
  {flags: "layer_apply"}
  ]})
```

```react_native
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_aspen.3dl"));
```

![video with the IWLTBAP sedona LUT applied](https://res.cloudinary.com/demo/video/upload/l_lut:iwltbap_sedona.3dl/fl_layer_apply/meadow_walk.mp4 "thumb: w_400")

```nodejs
cloudinary.video("meadow_walk", {transformation: [
  {overlay: "lut:iwltbap_sedona.3dl"},
  {flags: "layer_apply"}
  ]})
```

```react
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
```

```vue
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
```

```angular
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
```

```js
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
```

```python
CloudinaryVideo("meadow_walk").video(transformation=[
  {'overlay': "lut:iwltbap_sedona.3dl"},
  {'flags': "layer_apply"}
  ])
```

```php
use Cloudinary\Transformation\Adjust;

(new VideoTag('meadow_walk.mp4'))
	->adjust(Adjust::by3dLut("iwltbap_sedona.3dl"));
```

```java
cloudinary.url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_sedona.3dl")).chain()
  .flags("layer_apply")).videoTag("meadow_walk");
```

```ruby
cl_video_tag("meadow_walk", transformation: [
  {overlay: "lut:iwltbap_sedona.3dl"},
  {flags: "layer_apply"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Overlay(new Layer().PublicId("lut:iwltbap_sedona.3dl")).Chain()
  .Flags("layer_apply")).BuildVideoTag("meadow_walk")
```

```dart
cloudinary.video('meadow_walk.mp4').transformation(Transformation()
	.adjust(Adjust.by3dLut("iwltbap_sedona.3dl")));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setOverlay("lut:iwltbap_sedona.3dl").chain()
  .setFlags("layer_apply")).generate("meadow_walk.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .overlay(new Layer().publicId("lut:iwltbap_sedona.3dl")).chain()
  .flags("layer_apply")).resourceType("video").generate("meadow_walk.mp4");
```

```flutter
cloudinary.video('meadow_walk.mp4').transformation(Transformation()
	.adjust(Adjust.by3dLut("iwltbap_sedona.3dl")));
```

```kotlin
cloudinary.video {
	publicId("meadow_walk.mp4")
	 adjust(Adjust.by3dLut("iwltbap_sedona.3dl")) 
}.generate()
```

```jquery
$.cloudinary.video("meadow_walk", {transformation: [
  {overlay: new cloudinary.Layer().publicId("lut:iwltbap_sedona.3dl")},
  {flags: "layer_apply"}
  ]})
```

```react_native
import { by3dLut } from "@cloudinary/url-gen/actions/adjust";

new CloudinaryVideo("meadow_walk.mp4").adjust(by3dLut("iwltbap_sedona.3dl"));
```
## Borders

Add a solid border around videos with the `border` parameter (`bo` in URLs). The parameter accepts a value with a CSS-like format: `width_style_color` (e.g., `3px_solid_black`). 

An opaque color can be set as an RGB hex triplet (e.g., `rgb:3e2222`), a 3-digit RGB hex (e.g., `rgb:777`) or a named color (e.g., `green`). 

You can also use a 4-digit or 8-digit RGBA hex quadruplet for the color, where the 4th hex value represents the alpha (opacity) value (e.g., `co_rgb:3e222240` results in 25% opacity). 

Additionally, Cloudinary's client libraries also support a `#` shortcut for RGB (e.g., setting color to `#3e2222` which is then translated to `rgb:3e2222`), and when using Cloudinary's client libraries, you can optionally set the border values programmatically instead of as a single string (e.g., `border: { width: 4, color: 'black' }`).

> **NOTE**: Currently only the 'solid' border style is supported.

For example, the uploaded MP4 video named sunglasses delivered with a 5 pixel blue border:

![Image delivered with 5 pixel blue border](https://res.cloudinary.com/demo/image/upload/bo_5px_solid_blue/docs/blue_sweater.jpg "thumb: w_300")

```nodejs
cloudinary.image("docs/blue_sweater.jpg", {border: "5px_solid_blue"})
```

```react
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryImage("docs/blue_sweater.jpg").border(solid(5, "blue"));
```

```vue
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryImage("docs/blue_sweater.jpg").border(solid(5, "blue"));
```

```angular
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryImage("docs/blue_sweater.jpg").border(solid(5, "blue"));
```

```js
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryImage("docs/blue_sweater.jpg").border(solid(5, "blue"));
```

```python
CloudinaryImage("docs/blue_sweater.jpg").image(border="5px_solid_blue")
```

```php
use Cloudinary\Transformation\Border;
use Cloudinary\Transformation\Color;

(new ImageTag('docs/blue_sweater.jpg'))
	->border(Border::solid(5,Color::BLUE));
```

```java
cloudinary.url().transformation(new Transformation().border("5px_solid_blue")).imageTag("docs/blue_sweater.jpg");
```

```ruby
cl_image_tag("docs/blue_sweater.jpg", border: "5px_solid_blue")
```

```csharp
cloudinary.Api.UrlImgUp.Transform(new Transformation().Border("5px_solid_blue")).BuildImageTag("docs/blue_sweater.jpg")
```

```dart
cloudinary.image('docs/blue_sweater.jpg').transformation(Transformation()
	.border(Border.solid(5,Color.BLUE)));
```

```swift
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setBorder("5px_solid_blue")).generate("docs/blue_sweater.jpg")!, cloudinary: cloudinary)
```

```android
MediaManager.get().url().transformation(new Transformation().border("5px_solid_blue")).generate("docs/blue_sweater.jpg");
```

```flutter
cloudinary.image('docs/blue_sweater.jpg').transformation(Transformation()
	.border(Border.solid(5,Color.BLUE)));
```

```kotlin
cloudinary.image {
	publicId("docs/blue_sweater.jpg")
	 border(Border.solid(5,Color.BLUE)) 
}.generate()
```

```jquery
$.cloudinary.image("docs/blue_sweater.jpg", {border: "5px_solid_blue"})
```

```react_native
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryImage("docs/blue_sweater.jpg").border(solid(5, "blue"));
```
![Video delivered with 5 pixel blue border](https://res.cloudinary.com/demo/video/upload/bo_5px_solid_blue/docs/sunglasses.mp4 "thumb: w_500")

```nodejs
cloudinary.video("docs/sunglasses", {border: "5px_solid_blue"})
```

```react
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryVideo("docs/sunglasses.mp4").border(solid(5, "blue"));
```

```vue
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryVideo("docs/sunglasses.mp4").border(solid(5, "blue"));
```

```angular
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryVideo("docs/sunglasses.mp4").border(solid(5, "blue"));
```

```js
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryVideo("docs/sunglasses.mp4").border(solid(5, "blue"));
```

```python
CloudinaryVideo("docs/sunglasses").video(border="5px_solid_blue")
```

```php
use Cloudinary\Transformation\Border;

(new VideoTag('docs/sunglasses.mp4'))
	->border(Border::solid(5,Color::BLUE));
```

```java
cloudinary.url().transformation(new Transformation().border("5px_solid_blue")).videoTag("docs/sunglasses");
```

```ruby
cl_video_tag("docs/sunglasses", border: "5px_solid_blue")
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation().Border("5px_solid_blue")).BuildVideoTag("docs/sunglasses")
```

```dart
cloudinary.video('docs/sunglasses.mp4').transformation(Transformation()
	.border(Border.solid(5,Color.BLUE)));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation().setBorder("5px_solid_blue")).generate("docs/sunglasses.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation().border("5px_solid_blue")).resourceType("video").generate("docs/sunglasses.mp4");
```

```flutter
cloudinary.video('docs/sunglasses.mp4').transformation(Transformation()
	.border(Border.solid(5,Color.BLUE)));
```

```kotlin
cloudinary.video {
	publicId("docs/sunglasses.mp4")
	 border(Border.solid(5,Color.BLUE)) 
}.generate()
```

```jquery
$.cloudinary.video("docs/sunglasses", {border: "5px_solid_blue"})
```

```react_native
import { solid } from "@cloudinary/url-gen/actions/border";

new CloudinaryVideo("docs/sunglasses.mp4").border(solid(5, "blue"));
```

Borders are also useful for adding to overlays to clearly define the overlaying image, and also automatically adapt to any rounded corner transformations. For example, the base video given rounded corners with a 10 pixel grey border, and an overlay of the image of `sale` resized to a 100x100 thumbnail added to the northeast corner:

![Base image with rounded corners + overlay](https://res.cloudinary.com/demo/image/upload/c_scale,w_400/bo_10px_solid_grey,r_75/l_sale/c_thumb,w_100,h_100/fl_layer_apply,g_north_east,y_15,x_15/docs/rugged_shoes.jpg)

```nodejs
cloudinary.image("docs/rugged_shoes.jpg", {transformation: [
  {width: 400, crop: "scale"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: "sale"},
  {width: 100, height: 100, crop: "thumb"},
  {gravity: "north_east", y: 15, x: 15, flags: "layer_apply"}
  ]})
```

```react
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryImage("docs/rugged_shoes.jpg")
  .resize(scale().width(400))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  );
```

```vue
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryImage("docs/rugged_shoes.jpg")
  .resize(scale().width(400))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  );
```

```angular
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryImage("docs/rugged_shoes.jpg")
  .resize(scale().width(400))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  );
```

```js
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryImage("docs/rugged_shoes.jpg")
  .resize(scale().width(400))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  );
```

```python
CloudinaryImage("docs/rugged_shoes.jpg").image(transformation=[
  {'width': 400, 'crop': "scale"},
  {'border': "10px_solid_grey", 'radius': 75},
  {'overlay': "sale"},
  {'width': 100, 'height': 100, 'crop': "thumb"},
  {'gravity': "north_east", 'y': 15, 'x': 15, 'flags': "layer_apply"}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\Border;
use Cloudinary\Transformation\Overlay;
use Cloudinary\Transformation\Source;
use Cloudinary\Transformation\Position;
use Cloudinary\Transformation\RoundCorners;
use Cloudinary\Transformation\Gravity;
use Cloudinary\Transformation\Compass;

(new ImageTag('docs/rugged_shoes.jpg'))
	->resize(Resize::scale()->width(400))
	->border(Border::solid(10,Color::GREY)
	->roundCorners(
	RoundCorners::byRadius(75))
	)
	->overlay(Overlay::source(
	Source::image("sale")
	->transformation((new Transformation())
	->resize(Resize::thumbnail()->width(100)
->height(100)))
	)
	->position((new Position())
	->gravity(
	Gravity::compass(
	Compass::northEast()))
->offsetX(15)
->offsetY(15))
	);
```

```java
cloudinary.url().transformation(new Transformation()
  .width(400).crop("scale").chain()
  .border("10px_solid_grey").radius(75).chain()
  .overlay(new Layer().publicId("sale")).chain()
  .width(100).height(100).crop("thumb").chain()
  .gravity("north_east").y(15).x(15).flags("layer_apply")).imageTag("docs/rugged_shoes.jpg");
```

```ruby
cl_image_tag("docs/rugged_shoes.jpg", transformation: [
  {width: 400, crop: "scale"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: "sale"},
  {width: 100, height: 100, crop: "thumb"},
  {gravity: "north_east", y: 15, x: 15, flags: "layer_apply"}
  ])
```

```csharp
cloudinary.Api.UrlImgUp.Transform(new Transformation()
  .Width(400).Crop("scale").Chain()
  .Border("10px_solid_grey").Radius(75).Chain()
  .Overlay(new Layer().PublicId("sale")).Chain()
  .Width(100).Height(100).Crop("thumb").Chain()
  .Gravity("north_east").Y(15).X(15).Flags("layer_apply")).BuildImageTag("docs/rugged_shoes.jpg")
```

```dart
cloudinary.image('docs/rugged_shoes.jpg').transformation(Transformation()
	.resize(Resize.scale().width(400))
	.border(Border.solid(10,Color.GREY)
	.roundCorners(
	RoundCorners.byRadius(75))
	)
	.overlay(Overlay.source(
	Source.image("sale")
	.transformation(new Transformation()
	.resize(Resize.thumbnail().width(100)
.height(100)))
	)
	.position(Position()
	.gravity(
	Gravity.compass(
	Compass.northEast()))
.offsetX(15)
.offsetY(15))
	));
```

```swift
imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()
  .setWidth(400).setCrop("scale").chain()
  .setBorder("10px_solid_grey").setRadius(75).chain()
  .setOverlay("sale").chain()
  .setWidth(100).setHeight(100).setCrop("thumb").chain()
  .setGravity("north_east").setY(15).setX(15).setFlags("layer_apply")).generate("docs/rugged_shoes.jpg")!, cloudinary: cloudinary)
```

```android
MediaManager.get().url().transformation(new Transformation()
  .width(400).crop("scale").chain()
  .border("10px_solid_grey").radius(75).chain()
  .overlay(new Layer().publicId("sale")).chain()
  .width(100).height(100).crop("thumb").chain()
  .gravity("north_east").y(15).x(15).flags("layer_apply")).generate("docs/rugged_shoes.jpg");
```

```flutter
cloudinary.image('docs/rugged_shoes.jpg').transformation(Transformation()
	.addTransformation("c_scale,w_400/bo_10px_solid_grey,r_75/l_sale/c_thumb,w_100,h_100/fl_layer_apply,g_north_east,y_15,x_15"));
```

```kotlin
cloudinary.image {
	publicId("docs/rugged_shoes.jpg")
	 resize(Resize.scale() { width(400) })
	 border(Border.solid(10,Color.GREY) {
	 roundCorners(
	RoundCorners.byRadius(75))
	 })
	 overlay(Overlay.source(
	Source.image("sale") {
	 transformation(Transformation {
	 resize(Resize.thumbnail() { width(100)
 height(100) }) })
	 }) {
	 position(Position() {
	 gravity(
	Gravity.compass(
	Compass.northEast()))
 offsetX(15)
 offsetY(15) })
	 }) 
}.generate()
```

```jquery
$.cloudinary.image("docs/rugged_shoes.jpg", {transformation: [
  {width: 400, crop: "scale"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: new cloudinary.Layer().publicId("sale")},
  {width: 100, height: 100, crop: "thumb"},
  {gravity: "north_east", y: 15, x: 15, flags: "layer_apply"}
  ]})
```

```react_native
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryImage("docs/rugged_shoes.jpg")
  .resize(scale().width(400))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  );
```
![Base video with rounded corners + overlay](https://res.cloudinary.com/demo/video/upload/c_scale,w_500/bo_10px_solid_grey,r_75/l_sale/c_thumb,w_100,h_100/fl_layer_apply,g_north_east,y_15,x_15/v1664993417/pm/gallery/sunglasses.mp4)

```nodejs
cloudinary.video("pm/gallery/sunglasses", {transformation: [
  {width: 500, crop: "scale"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: "sale"},
  {width: 100, height: 100, crop: "thumb"},
  {gravity: "north_east", y: 15, x: 15, flags: "layer_apply"}
  ]})
```

```react
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("pm/gallery/sunglasses.mp4")
  .resize(scale().width(500))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  )
  .setVersion(1664993417);
```

```vue
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("pm/gallery/sunglasses.mp4")
  .resize(scale().width(500))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  )
  .setVersion(1664993417);
```

```angular
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("pm/gallery/sunglasses.mp4")
  .resize(scale().width(500))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  )
  .setVersion(1664993417);
```

```js
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("pm/gallery/sunglasses.mp4")
  .resize(scale().width(500))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  )
  .setVersion(1664993417);
```

```python
CloudinaryVideo("pm/gallery/sunglasses").video(transformation=[
  {'width': 500, 'crop': "scale"},
  {'border': "10px_solid_grey", 'radius': 75},
  {'overlay': "sale"},
  {'width': 100, 'height': 100, 'crop': "thumb"},
  {'gravity': "north_east", 'y': 15, 'x': 15, 'flags': "layer_apply"}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\Border;
use Cloudinary\Transformation\Overlay;
use Cloudinary\Transformation\Source;
use Cloudinary\Transformation\Position;
use Cloudinary\Transformation\RoundCorners;
use Cloudinary\Transformation\Gravity;
use Cloudinary\Transformation\Compass;

(new VideoTag('pm/gallery/sunglasses.mp4'))
	->resize(Resize::scale()->width(500))
	->border(Border::solid(10,Color::GREY)
	->roundCorners(
	RoundCorners::byRadius(75))
	)
	->overlay(Overlay::source(
	Source::image("sale")
	->transformation((new Transformation())
	->resize(Resize::thumbnail()->width(100)
->height(100)))
	)
	->position((new Position())
	->gravity(
	Gravity::compass(
	Compass::northEast()))
->offsetX(15)
->offsetY(15))
	)
	->version(1664993417);
```

```java
cloudinary.url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .border("10px_solid_grey").radius(75).chain()
  .overlay(new Layer().publicId("sale")).chain()
  .width(100).height(100).crop("thumb").chain()
  .gravity("north_east").y(15).x(15).flags("layer_apply")).videoTag("pm/gallery/sunglasses");
```

```ruby
cl_video_tag("pm/gallery/sunglasses", transformation: [
  {width: 500, crop: "scale"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: "sale"},
  {width: 100, height: 100, crop: "thumb"},
  {gravity: "north_east", y: 15, x: 15, flags: "layer_apply"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(500).Crop("scale").Chain()
  .Border("10px_solid_grey").Radius(75).Chain()
  .Overlay(new Layer().PublicId("sale")).Chain()
  .Width(100).Height(100).Crop("thumb").Chain()
  .Gravity("north_east").Y(15).X(15).Flags("layer_apply")).BuildVideoTag("pm/gallery/sunglasses")
```

```dart
cloudinary.video('pm/gallery/sunglasses.mp4').transformation(Transformation()
	.resize(Resize.scale().width(500))
	.border(Border.solid(10,Color.GREY)
	.roundCorners(
	RoundCorners.byRadius(75))
	)
	.overlay(Overlay.source(
	Source.image("sale")
	.transformation(new Transformation()
	.resize(Resize.thumbnail().width(100)
.height(100)))
	)
	.position(Position()
	.gravity(
	Gravity.compass(
	Compass.northEast()))
.offsetX(15)
.offsetY(15))
	)
	.version(1664993417));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(500).setCrop("scale").chain()
  .setBorder("10px_solid_grey").setRadius(75).chain()
  .setOverlay("sale").chain()
  .setWidth(100).setHeight(100).setCrop("thumb").chain()
  .setGravity("north_east").setY(15).setX(15).setFlags("layer_apply")).generate("pm/gallery/sunglasses.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .border("10px_solid_grey").radius(75).chain()
  .overlay(new Layer().publicId("sale")).chain()
  .width(100).height(100).crop("thumb").chain()
  .gravity("north_east").y(15).x(15).flags("layer_apply")).resourceType("video").generate("pm/gallery/sunglasses.mp4");
```

```flutter
cloudinary.video('pm/gallery/sunglasses.mp4').transformation(Transformation()
	.addTransformation("c_scale,w_500/bo_10px_solid_grey,r_75/l_sale/c_thumb,w_100,h_100/fl_layer_apply,g_north_east,y_15,x_15")
	.version(1664993417));
```

```kotlin
cloudinary.video {
	publicId("pm/gallery/sunglasses.mp4")
	 resize(Resize.scale() { width(500) })
	 border(Border.solid(10,Color.GREY) {
	 roundCorners(
	RoundCorners.byRadius(75))
	 })
	 overlay(Overlay.source(
	Source.image("sale") {
	 transformation(Transformation {
	 resize(Resize.thumbnail() { width(100)
 height(100) }) })
	 }) {
	 position(Position() {
	 gravity(
	Gravity.compass(
	Compass.northEast()))
 offsetX(15)
 offsetY(15) })
	 })
	 version(1664993417) 
}.generate()
```

```jquery
$.cloudinary.video("pm/gallery/sunglasses", {transformation: [
  {width: 500, crop: "scale"},
  {border: "10px_solid_grey", radius: 75},
  {overlay: new cloudinary.Layer().publicId("sale")},
  {width: 100, height: 100, crop: "thumb"},
  {gravity: "north_east", y: 15, x: 15, flags: "layer_apply"}
  ]})
```

```react_native
import { scale, thumbnail } from "@cloudinary/url-gen/actions/resize";
import { solid } from "@cloudinary/url-gen/actions/border";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { image } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { byRadius } from "@cloudinary/url-gen/qualifiers/roundCorners";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("pm/gallery/sunglasses.mp4")
  .resize(scale().width(500))
  .border(solid(10, "grey").roundCorners(byRadius(75)))
  .overlay(
    source(
      image("sale").transformation(
        new Transformation().resize(thumbnail().width(100).height(100))
      )
    ).position(
      new Position()
        .gravity(compass("north_east"))
        .offsetX(15)
        .offsetY(15)
    )
  )
  .setVersion(1664993417);
```

**See full syntax**: [bo (border)](transformation_reference#bo_border) in the _Transformation Reference_.

## Transparency

You can convert any relatively solid color in a video overlay to be fully transparent, thus making the base video visible in the transparent areas. This means you can remove plain colored backgrounds from a video overlay or remove a solid colored element from the subject of a video overlay, such that the content of the video behind that element shows through. This functionality works like a **green-screen** effect, but can be applied to any HEX color.

To make a color transparent in your video overlay, apply both the `make_transparent` effect (`e_make_transparent` in URLs) and the `color` parameter (`co_` in URLs) to your video overlay component. You can also specify a tolerance value for the `make_transparent` effect to allow for minor differences in the shade of the specified color.

> **NOTE**: The `make_transparent` parameter is supported only for videos within an overlay component. You cannot apply this parameter to a video without an overlay.

For example, suppose you have the following product video that was produced with a blue screen background:

![Watches product video with blue screen background](https://res.cloudinary.com/demo/video/upload/w_500/docs/bluescreen_watches.mp4 "with_code:false, with_url:false")

You could use that product video as an overlay on top of a video showing a nice background scene. You could then make the blue background of your overlay video transparent using the `make_transparent` parameter together with the `color` parameter set to the Hex color #0e80d8 (the specific shade of blue used in this video). 

![Watches product video with transparent background](https://res.cloudinary.com/demo/video/upload/c_scale,w_500/l_video:docs:bluescreen_watches/c_scale,fl_relative,w_0.6/co_rgb:0e80d8,e_make_transparent:20/fl_layer_apply,g_north/du_15.0/docs/sunset_waves.mp4 "poster:https://res.cloudinary.com/demo/image/upload/w_500/f_auto/q_auto/docs/sunset_waves_watches_poster.jpg")

```nodejs
cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: "video:docs:bluescreen_watches"},
  {width: "0.6", flags: "relative", crop: "scale"},
  {color: "#0e80d8", effect: "make_transparent:20"},
  {gravity: "north", flags: "layer_apply"},
  {duration: "15.0"}
  ]})
```

```react
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
```

```vue
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
```

```angular
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
```

```js
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
```

```python
CloudinaryVideo("docs/sunset_waves").video(transformation=[
  {'width': 500, 'crop': "scale"},
  {'overlay': "video:docs:bluescreen_watches"},
  {'width': "0.6", 'flags': "relative", 'crop': "scale"},
  {'color': "#0e80d8", 'effect': "make_transparent:20"},
  {'gravity': "north", 'flags': "layer_apply"},
  {'duration': "15.0"}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\Overlay;
use Cloudinary\Transformation\VideoEdit;
use Cloudinary\Transformation\Effect;
use Cloudinary\Transformation\Source;
use Cloudinary\Transformation\Position;
use Cloudinary\Transformation\Gravity;
use Cloudinary\Transformation\Compass;

(new VideoTag('docs/sunset_waves.mp4'))
	->resize(Resize::scale()->width(500))
	->overlay(Overlay::source(
	Source::video("docs/bluescreen_watches")
	->transformation((new Transformation())
	->resize(Resize::scale()->width(0.6)
	->relative()
	)
	->effect(Effect::makeTransparent()->tolerance(20)
	->colorToReplace(Color::rgb("0e80d8"))
	))
	)
	->position((new Position())
	->gravity(
	Gravity::compass(
	Compass::north()))
	)
	)
	->videoEdit(VideoEdit::trim()->duration(15.0));
```

```java
cloudinary.url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .width(0.6).flags("relative").crop("scale").chain()
  .color("#0e80d8").effect("make_transparent:20").chain()
  .gravity("north").flags("layer_apply").chain()
  .duration("15.0")).videoTag("docs/sunset_waves");
```

```ruby
cl_video_tag("docs/sunset_waves", transformation: [
  {width: 500, crop: "scale"},
  {overlay: "video:docs:bluescreen_watches"},
  {width: 0.6, flags: "relative", crop: "scale"},
  {color: "#0e80d8", effect: "make_transparent:20"},
  {gravity: "north", flags: "layer_apply"},
  {duration: "15.0"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(500).Crop("scale").Chain()
  .Overlay(new Layer().PublicId("video:docs:bluescreen_watches")).Chain()
  .Width(0.6).Flags("relative").Crop("scale").Chain()
  .Color("#0e80d8").Effect("make_transparent:20").Chain()
  .Gravity("north").Flags("layer_apply").Chain()
  .Duration("15.0")).BuildVideoTag("docs/sunset_waves")
```

```dart
cloudinary.video('docs/sunset_waves.mp4').transformation(Transformation()
	.resize(Resize.scale().width(500))
	.overlay(Overlay.source(
	Source.video("docs/bluescreen_watches")
	.transformation(new Transformation()
	.resize(Resize.scale().width(0.6)
	.relative()
	)
	.effect(Effect.makeTransparent().tolerance(20)
	.colorToReplace(Color.rgb("0e80d8"))
	))
	)
	.position(Position()
	.gravity(
	Gravity.compass(
	Compass.north()))
	)
	)
	.videoEdit(VideoEdit.trim().duration('15.0')));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(500).setCrop("scale").chain()
  .setOverlay("video:docs:bluescreen_watches").chain()
  .setWidth(0.6).setFlags("relative").setCrop("scale").chain()
  .setColor("#0e80d8").setEffect("make_transparent:20").chain()
  .setGravity("north").setFlags("layer_apply").chain()
  .setDuration("15.0")).generate("docs/sunset_waves.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .width(0.6).flags("relative").crop("scale").chain()
  .color("#0e80d8").effect("make_transparent:20").chain()
  .gravity("north").flags("layer_apply").chain()
  .duration("15.0")).resourceType("video").generate("docs/sunset_waves.mp4");
```

```flutter
cloudinary.video('docs/sunset_waves.mp4').transformation(Transformation()
	.resize(Resize.scale().width(500))
	.overlay(Overlay.source(
	Source.video("docs/bluescreen_watches")
	.transformation(new Transformation()
	.resize(Resize.scale().width(0.6)
	.relative()
	)
	.effect(Effect.makeTransparent().tolerance(20)
	.colorToReplace(Color.rgb("0e80d8"))
	))
	)
	.position(Position()
	.gravity(
	Gravity.compass(
	Compass.north()))
	)
	)
	.videoEdit(VideoEdit.trim().duration('15.0')));
```

```kotlin
cloudinary.video {
	publicId("docs/sunset_waves.mp4")
	 resize(Resize.scale() { width(500) })
	 overlay(Overlay.source(
	Source.video("docs/bluescreen_watches") {
	 transformation(Transformation {
	 resize(Resize.scale() { width(0.6F)
	 relative()
	 })
	 effect(Effect.makeTransparent() { tolerance(20)
	 colorToReplace(Color.rgb("0e80d8"))
	 }) })
	 }) {
	 position(Position() {
	 gravity(
	Gravity.compass(
	Compass.north()))
	 })
	 })
	 videoEdit(VideoEdit.trim() { duration(15.0F) }) 
}.generate()
```

```jquery
$.cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:docs:bluescreen_watches")},
  {width: "0.6", flags: "relative", crop: "scale"},
  {color: "#0e80d8", effect: "make_transparent:20"},
  {gravity: "north", flags: "layer_apply"},
  {duration: "15.0"}
  ]})
```

```react_native
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";
import { Position } from "@cloudinary/url-gen/qualifiers/position";
import { compass } from "@cloudinary/url-gen/qualifiers/gravity";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width(0.6).relative())
          .effect(makeTransparent().tolerance(20).colorToReplace("#0e80d8"))
      )
    ).position(new Position().gravity(compass("north")))
  )
  .videoEdit(trim().duration("15.0"));
```

> **TIP**:
>
> It's often useful to set the size of your overlay video to be **relative** to the base video. For example, note the use of `w_0.6` and `fl_relative`, along with `g_north` in the URL above, which makes the overlay video 60% smaller than the background video and places the overlay over the north part of the background video, in order to get the desired effect.

The `make_transparent` parameter is not limited to removing backgrounds. For example, in the above video, instead of setting the transparency color to the blue background color, you could set it to the color of the green stripe inside the watches, and then the background video would show only in place of the green stripes. 
(For this use case, `w_1.0`, `fl_relative` was used so that the overlay video would completely cover the background video, except where the overlay is transparent.)

![Watches product video with transparent stripes](https://res.cloudinary.com/demo/video/upload/c_scale,w_500/l_video:docs:bluescreen_watches/c_scale,fl_relative,w_1.0/co_rgb:3d8d48,e_make_transparent:10/fl_layer_apply/du_15.0/docs/sunset_waves.mp4 "with_image:false")

```nodejs
cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: "video:docs:bluescreen_watches"},
  {width: "1.0", flags: "relative", crop: "scale"},
  {color: "#3d8d48", effect: "make_transparent:10"},
  {flags: "layer_apply"},
  {duration: "15.0"}
  ]})
```

```react
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
```

```vue
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
```

```angular
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
```

```js
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
```

```python
CloudinaryVideo("docs/sunset_waves").video(transformation=[
  {'width': 500, 'crop': "scale"},
  {'overlay': "video:docs:bluescreen_watches"},
  {'width': "1.0", 'flags': "relative", 'crop': "scale"},
  {'color': "#3d8d48", 'effect': "make_transparent:10"},
  {'flags': "layer_apply"},
  {'duration': "15.0"}
  ])
```

```php
use Cloudinary\Transformation\Resize;
use Cloudinary\Transformation\Overlay;
use Cloudinary\Transformation\VideoEdit;
use Cloudinary\Transformation\Effect;
use Cloudinary\Transformation\Source;

(new VideoTag('docs/sunset_waves.mp4'))
	->resize(Resize::scale()->width(500))
	->overlay(Overlay::source(
	Source::video("docs/bluescreen_watches")
	->transformation((new Transformation())
	->resize(Resize::scale()->width(1.0)
	->relative()
	)
	->effect(Effect::makeTransparent()->tolerance(10)
	->colorToReplace(Color::rgb("3d8d48"))
	))
	))
	->videoEdit(VideoEdit::trim()->duration(15.0));
```

```java
cloudinary.url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .width(1.0).flags("relative").crop("scale").chain()
  .color("#3d8d48").effect("make_transparent:10").chain()
  .flags("layer_apply").chain()
  .duration("15.0")).videoTag("docs/sunset_waves");
```

```ruby
cl_video_tag("docs/sunset_waves", transformation: [
  {width: 500, crop: "scale"},
  {overlay: "video:docs:bluescreen_watches"},
  {width: 1.0, flags: "relative", crop: "scale"},
  {color: "#3d8d48", effect: "make_transparent:10"},
  {flags: "layer_apply"},
  {duration: "15.0"}
  ])
```

```csharp
cloudinary.Api.UrlVideoUp.Transform(new Transformation()
  .Width(500).Crop("scale").Chain()
  .Overlay(new Layer().PublicId("video:docs:bluescreen_watches")).Chain()
  .Width(1.0).Flags("relative").Crop("scale").Chain()
  .Color("#3d8d48").Effect("make_transparent:10").Chain()
  .Flags("layer_apply").Chain()
  .Duration("15.0")).BuildVideoTag("docs/sunset_waves")
```

```dart
cloudinary.video('docs/sunset_waves.mp4').transformation(Transformation()
	.resize(Resize.scale().width(500))
	.overlay(Overlay.source(
	Source.video("docs/bluescreen_watches")
	.transformation(new Transformation()
	.resize(Resize.scale().width('1.0')
	.relative()
	)
	.effect(Effect.makeTransparent().tolerance(10)
	.colorToReplace(Color.rgb("3d8d48"))
	))
	))
	.videoEdit(VideoEdit.trim().duration('15.0')));
```

```swift
cloudinary.createUrl().setResourceType("video").setTransformation(CLDTransformation()
  .setWidth(500).setCrop("scale").chain()
  .setOverlay("video:docs:bluescreen_watches").chain()
  .setWidth(1.0).setFlags("relative").setCrop("scale").chain()
  .setColor("#3d8d48").setEffect("make_transparent:10").chain()
  .setFlags("layer_apply").chain()
  .setDuration("15.0")).generate("docs/sunset_waves.mp4")
```

```android
MediaManager.get().url().transformation(new Transformation()
  .width(500).crop("scale").chain()
  .overlay(new Layer().publicId("video:docs:bluescreen_watches")).chain()
  .width(1.0).flags("relative").crop("scale").chain()
  .color("#3d8d48").effect("make_transparent:10").chain()
  .flags("layer_apply").chain()
  .duration("15.0")).resourceType("video").generate("docs/sunset_waves.mp4");
```

```flutter
cloudinary.video('docs/sunset_waves.mp4').transformation(Transformation()
	.resize(Resize.scale().width(500))
	.overlay(Overlay.source(
	Source.video("docs/bluescreen_watches")
	.transformation(new Transformation()
	.resize(Resize.scale().width('1.0')
	.relative()
	)
	.effect(Effect.makeTransparent().tolerance(10)
	.colorToReplace(Color.rgb("3d8d48"))
	))
	))
	.videoEdit(VideoEdit.trim().duration('15.0')));
```

```kotlin
cloudinary.video {
	publicId("docs/sunset_waves.mp4")
	 resize(Resize.scale() { width(500) })
	 overlay(Overlay.source(
	Source.video("docs/bluescreen_watches") {
	 transformation(Transformation {
	 resize(Resize.scale() { width(1.0F)
	 relative()
	 })
	 effect(Effect.makeTransparent() { tolerance(10)
	 colorToReplace(Color.rgb("3d8d48"))
	 }) })
	 }))
	 videoEdit(VideoEdit.trim() { duration(15.0F) }) 
}.generate()
```

```jquery
$.cloudinary.video("docs/sunset_waves", {transformation: [
  {width: 500, crop: "scale"},
  {overlay: new cloudinary.Layer().publicId("video:docs:bluescreen_watches")},
  {width: "1.0", flags: "relative", crop: "scale"},
  {color: "#3d8d48", effect: "make_transparent:10"},
  {flags: "layer_apply"},
  {duration: "15.0"}
  ]})
```

```react_native
import { scale } from "@cloudinary/url-gen/actions/resize";
import { source } from "@cloudinary/url-gen/actions/overlay";
import { trim } from "@cloudinary/url-gen/actions/videoEdit";
import { makeTransparent } from "@cloudinary/url-gen/actions/effect";
import { video } from "@cloudinary/url-gen/qualifiers/source";

new CloudinaryVideo("docs/sunset_waves.mp4")
  .resize(scale().width(500))
  .overlay(
    source(
      video("docs/bluescreen_watches").transformation(
        new Transformation()
          .resize(scale().width("1.0").relative())
          .effect(makeTransparent().tolerance(10).colorToReplace("#3d8d48"))
      )
    )
  )
  .videoEdit(trim().duration("15.0"));
```

  
  
  

**See full syntax**: [e_make_transparent](transformation_reference#e_make_transparent) in the _Transformation Reference_.

### Transparent delivery

Transparent videos provide a great way to display moving or animated content over the top of your web or mobile application design. For example, the video below has a water droplets background image set with CSS. Video transparency is currently only supported for direct delivery in the `webm` format. As a result, the example video below will not display on browsers that don't support the `webm` format and you'll see only the background or a broken video.

![transparent webm example](https://res.cloudinary.com/demo/video/upload/docs/transparent_talking.webm "with_image: false")

```nodejs
cloudinary.video("docs/transparent_talking")
```

```react
new CloudinaryVideo("docs/transparent_talking.webm");
```

```vue
new CloudinaryVideo("docs/transparent_talking.webm");
```

```angular
new CloudinaryVideo("docs/transparent_talking.webm");
```

```js
new CloudinaryVideo("docs/transparent_talking.webm");
```

```python
CloudinaryVideo("docs/transparent_talking").video()
```

```php
(new VideoTag('docs/transparent_talking.webm'));
```

```java
cloudinary.url().transformation(new Transformation().videoTag("docs/transparent_talking");
```

```ruby
cl_video_tag("docs/transparent_talking")
```

```csharp
cloudinary.Api.UrlVideoUp.BuildVideoTag("docs/transparent_talking")
```

```dart
cloudinary.video('docs/transparent_talking.webm').transformation(Transformation());
```

```swift
cloudinary.createUrl().setResourceType("video").generate("docs/transparent_talking.webm")
```

```android
MediaManager.get().url().transformation(new Transformation().resourceType("video").generate("docs/transparent_talking.webm");
```

```flutter
cloudinary.video('docs/transparent_talking.webm').transformation(Transformation());
```

```kotlin
cloudinary.video {
	publicId("docs/transparent_talking.webm") 
}.generate()
```

```jquery
$.cloudinary.video("docs/transparent_talking")
```

```react_native
new CloudinaryVideo("docs/transparent_talking.webm");
```

  


For browsers that don't support video transparency, you can use the Cloudinary JavaScript SDK to configure a fallback. The fallback checks if the browser is compatible and, if not, makes use of an HTML5 canvas element to deliver the video with transparency. The example below works across most modern browsers. You can see how the transparent video looks on top of the existing page by clicking the `Toggle video position` button.

Toggle video position

### Cross-browser supported transparent videos

To add transparent videos that are supported on most browsers, you'll need to use the `cloudinary-core` JavaScript library. Follow the [get started](javascript1_integration#get_started) instructions for how to add this to your website or application. To add a transparent video follow the steps below:

1. Create an html `div` element on your page for the transparent video and give it an `id`.
2. In your JavaScript, create a new instance of Cloudinary using your cloud name. For example:  

    ```js
    let myCloudinary = new cloudinary.Cloudinary({cloud_name: 'demo'});
    ```
3. Inject the transparent video into the element that you created using the `injectTransparentVideoElement` method. The method takes the `id` of the element, the public id of the transparent video and an options object to allow additional configuration, including any [supported video transformations](transformation_reference). For example:
  
    ```js
    myCloudinary.injectTransparentVideoElement(container, 'docs/transparent_girl', {
      loop: true,
      playsinline: true,
      width: 400,
      quality: "auto:best"
    })
    ```

Here's a full example of the code used to generate the example above:

```html

<div id="container" style="margin: 0 auto;display: block; width:400px"></div>
<script src='https://cdn.jsdelivr.net/npm/cloudinary-core@2.13.1/cloudinary-core.min.js' type='text/javascript'></script>
<script type="text/javascript">
  let myCloudinary = new cloudinary.Cloudinary({cloud_name: 'demo'});
  let container = document.getElementById('container');
  myCloudinary.injectTransparentVideoElement(container, 'docs/transparent_girl', {
    loop: true,
    playsinline: true,
    max_timeout_ms: 15000,
    width: 400,
    quality: "auto:best"
  }).catch((err) => {
    console.log(err);
  });
</script>
```

> **READING**:
>
> * [Video effects and enhancements](video_effects_and_enhancements): Overview of all video effects and enhancements.

> * [Video artistic effects](video_artistic_effects): Blur, deshake, vignette, and visual noise.

> * [Video playback effects](video_playback_effects): Fade, loop, playback speed, reverse, boomerang, and progress bar.

> * [Video reshaping and rotating](video_reshaping_and_rotating): Rotating and rounding videos.

> * [Video previews and posters](video_previews_and_posters): AI-based previews, thumbnails, and poster images.

