Skip to content

Commit bd75f7a

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
updated readme.md
1 parent 4e64d22 commit bd75f7a

1 file changed

Lines changed: 55 additions & 6 deletions

File tree

README.md

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ import { IKImage, IKVideo, IKContext, IKUpload } from 'imagekitio-react'
9999
"rotation": "90"
100100
}]} />
101101

102-
// Renders an image with text overlaid.
103-
<IKImage
104-
path="/default-image.jpg"
105-
transformation={[{ "width": 300, "height": 300 },{ "raw": "l-text,i-Imagekit,rt-90,co-0651D5,fs-50,l-end" }]}
106-
/>
107-
108102
// Lazy loading image
109103
<IKImage
110104
path="/default-image.jpg"
@@ -284,6 +278,61 @@ transformation = [
284278

285279
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.
286280

281+
## Adding overlays
282+
283+
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.
284+
285+
**Text as overlays**
286+
287+
You can add any text string over a base video or image using a text layer (l-text).
288+
289+
For example:
290+
291+
```js
292+
<IKImage
293+
path="/default-image.jpg"
294+
transformation={[{ "width": 300, "height": 400 },{ "raw": "l-text,i-Imagekit,fs-50,l-end" }]}
295+
/>
296+
```
297+
**Sample Result URL**
298+
```
299+
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-text,i-Imagekit,fs-50,l-end/default-image.jpg
300+
```
301+
302+
**Image as overlays**
303+
304+
You can add an image over a base video or image using an image layer (l-image).
305+
306+
For example:
307+
308+
```js
309+
<IKImage
310+
path="/default-image.jpg"
311+
transformation={[{ "width": 300, "height": 400 },{ "raw": "l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end" }]}
312+
/>
313+
```
314+
**Sample Result URL**
315+
```
316+
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
317+
```
318+
319+
**Solid color blocks as overlays**
320+
321+
You can add solid color blocks over a base video or image using an image layer (l-image).
322+
323+
For example:
324+
325+
```js
326+
<IKVideo
327+
path="/img/sample-video.mp4"
328+
transformation={[{ "width": 300, "height": 400 },{ "raw": "l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end" }]}
329+
/>
330+
```
331+
**Sample Result URL**
332+
```
333+
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
334+
```
335+
287336
### List of supported transformations
288337
<details>
289338
<summary>Expand</summary>

0 commit comments

Comments
 (0)