Skip to content

Commit 05109d0

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
update readme.md
1 parent d0e1cd3 commit 05109d0

File tree

1 file changed

+67
-37
lines changed

1 file changed

+67
-37
lines changed

README.md

Lines changed: 67 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,79 @@ var imageURL = imagekit.url({
175175
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400/default-image.jpg?v=123&ik-t=1567358667&ik-s=f2c7cdacbe7707b71a83d49cf1c6110e3d701054
176176
```
177177

178+
**4. Adding overlays**
179+
180+
ImageKit.io enables you to apply overlays to [images](https://docs.imagekit.io/features/image-transformations/overlay-using-layers) and [videos](https://docs.imagekit.io/features/video-transformation/overlay) using the raw parameter with the concept of [layers](https://docs.imagekit.io/features/image-transformations/overlay-using-layers#layers). The raw parameter facilitates incorporating transformations directly in the URL. A layer is a distinct type of transformation that allows you to define an asset to serve as an overlay, along with its positioning and additional transformations.
181+
182+
**Text as overlays**
183+
184+
You can add any text string over a base video or image using a text layer (l-text).
185+
186+
For example:
187+
188+
```js
189+
var imageURL = imagekit.url({
190+
src: "https://ik.imagekit.io/your_imagekit_id/default-image.jpg",
191+
transformation: [{
192+
"width": 400,
193+
"height": 300
194+
"raw": "l-text,i-Imagekit,fs-50,l-end"
195+
}]
196+
});
197+
```
198+
**Sample Result URL**
199+
```
200+
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-text,i-Imagekit,fs-50,l-end/default-image.jpg
201+
```
202+
203+
**Image as overlays**
204+
205+
You can add an image over a base video or image using an image layer (l-image).
206+
207+
For example:
208+
209+
```js
210+
var imageURL = imagekit.url({
211+
src: "https://ik.imagekit.io/your_imagekit_id/default-image.jpg",
212+
transformation: [{
213+
"width": 400,
214+
"height": 300
215+
"raw": "l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end"
216+
}]
217+
});
218+
```
219+
**Sample Result URL**
220+
```
221+
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end/default-image.jpg
222+
```
223+
224+
**Solid color blocks as overlays**
225+
226+
You can add solid color blocks over a base video or image using an image layer (l-image).
227+
228+
For example:
229+
230+
```js
231+
var imageURL = imagekit.url({
232+
src: "https://ik.imagekit.io/your_imagekit_id/img/sample-video.mp4",
233+
transformation: [{
234+
"width": 400,
235+
"height": 300
236+
"raw": "l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end"
237+
}]
238+
});
239+
```
240+
**Sample Result URL**
241+
```
242+
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end/img/sample-video.mp4
243+
```
244+
178245
#### List of supported transformations
179246

180247
See the complete list of transformations supported in ImageKit [here](https://docs.imagekit.io/features/image-transformations). The SDK gives a name to each transformation parameter e.g. `height` for `h` and `width` for `w` parameter. It makes your code more readable. If the property does not match any of the following supported options, it is added as it is.
181248

182249
If you want to generate transformations in your application and add them to the URL as it is, use the `raw` parameter.
183250

184-
<br/>
185-
186-
> #### Deprecation notice
187-
> The list below mentions the old overlay syntax parameters such as `oi`, `ot`, `obg`, and more. These parameters will be deprecated on 31st Oct 2023 and will start returning errors when used in URLs. Please migrate to the new Layers syntax that supports overlay nesting, provides better positional control, and allows more transformations at the layer level. You can start with [examples](https://docs.imagekit.io/features/image-transformations/overlay-using-layers#examples) to learn quickly.
188-
> If you create overlay transformations using the Node.js SDK, you can migrate to the new Layers syntax using the `raw` transformation parameter, as given in the example below.
189-
> `transformation : [{ "width" : 300, "height" : 300 },{ "raw": "l-image,i-logo.png,w-10,rt-90,l-end" }]`
190-
191-
<br/>
192251

193252
| Supported Transformation Name | Translates to parameter |
194253
|-------------------------------|-------------------------|
@@ -208,35 +267,6 @@ If you want to generate transformations in your application and add them to the
208267
| rotation | rt |
209268
| blur | bl |
210269
| named | n |
211-
| overlayX | ox |
212-
| overlayY | oy |
213-
| overlayFocus | ofo |
214-
| overlayHeight | oh |
215-
| overlayWidth | ow |
216-
| overlayImage | oi |
217-
| overlayImageTrim | oit |
218-
| overlayImageAspectRatio | oiar |
219-
| overlayImageBackground | oibg |
220-
| overlayImageBorder | oib |
221-
| overlayImageDPR | oidpr |
222-
| overlayImageQuality | oiq |
223-
| overlayImageCropping | oic |
224-
| overlayImageFocus | oifo |
225-
| overlayImageTrim | oit |
226-
| overlayText | ot |
227-
| overlayTextFontSize | ots |
228-
| overlayTextFontFamily | otf |
229-
| overlayTextColor | otc |
230-
| overlayTextTransparency | oa |
231-
| overlayAlpha | oa |
232-
| overlayTextTypography | ott |
233-
| overlayBackground | obg |
234-
| overlayTextEncoded | ote |
235-
| overlayTextWidth | otw |
236-
| overlayTextBackground | otbg |
237-
| overlayTextPadding | otp |
238-
| overlayTextInnerAlignment | otia |
239-
| overlayRadius | or |
240270
| progressive | pr |
241271
| lossless | lo |
242272
| trim | t |

0 commit comments

Comments
 (0)