Skip to content

Commit c4fade9

Browse files
authored
Merge pull request #58 from imagekit-developer/update-overlay-syntax
Update overlay syntax
2 parents e150e6a + b7c1ab9 commit c4fade9

File tree

1 file changed

+70
-28
lines changed

1 file changed

+70
-28
lines changed

README.md

Lines changed: 70 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,76 @@ Sample Result URL -
222222
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400/default-image.jpg?p1=123&p2=345&ik-t=1658899345&ik-s=8f03aca28432d4e87f697a48143efb4497bbed9e
223223
```
224224

225+
**4. Adding overlays**
226+
227+
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.
228+
229+
**Text as overlays**
230+
231+
You can add any text string over a base video or image using a text layer (l-text).
232+
233+
For example:
234+
235+
```python
236+
image_url = imagekit.url({
237+
"path": "/default-image",
238+
"url_endpoint": "https://ik.imagekit.io/your_imagekit_id/endpoint/",
239+
"transformation": [{
240+
"height": "300",
241+
"width": "400",
242+
"raw": "l-text,i-Imagekit,fs-50,l-end"
243+
}],
244+
})
245+
```
246+
**Sample Result URL**
247+
```
248+
https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-text,i-Imagekit,fs-50,l-end/default-image.jpg
249+
```
250+
251+
**Image as overlays**
252+
253+
You can add an image over a base video or image using an image layer (l-image).
254+
255+
For example:
256+
257+
```python
258+
image_url = imagekit.url({
259+
"path": "/default-image",
260+
"url_endpoint": "https://ik.imagekit.io/your_imagekit_id/endpoint/",
261+
"transformation": [{
262+
"height": "300",
263+
"width": "400",
264+
"raw": "l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end"
265+
}],
266+
})
267+
```
268+
**Sample Result URL**
269+
```
270+
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
271+
```
272+
273+
**Solid color blocks as overlays**
274+
275+
You can add solid color blocks over a base video or image using an image layer (l-image).
276+
277+
For example:
278+
279+
```python
280+
image_url = imagekit.url({
281+
"path": "/img/sample-video",
282+
"url_endpoint": "https://ik.imagekit.io/your_imagekit_id/endpoint/",
283+
"transformation": [{
284+
"height": "300",
285+
"width": "400",
286+
"raw": "l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end"
287+
}],
288+
})
289+
```
290+
**Sample Result URL**
291+
```
292+
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
293+
```
294+
225295
**List of transformations**
226296

227297
The complete list of transformations supported and their usage in ImageKit is available [here](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations).
@@ -247,34 +317,6 @@ If you want to generate transformations in your application and add them to the
247317
| rotation | rt |
248318
| blur | bl |
249319
| named | n |
250-
| overlay_x | ox |
251-
| overlay_y | oy |
252-
| overlay_focus | ofo |
253-
| overlay_height | oh |
254-
| overlay_width | ow |
255-
| overlay_image | oi |
256-
| overlay_image_trim | oit |
257-
| overlay_image_aspect_ratio | oiar |
258-
| overlay_image_background | oibg |
259-
| overlay_image_border | oib |
260-
| overlay_image_dpr | oidpr |
261-
| overlay_image_quality | oiq |
262-
| overlay_image_cropping | oic |
263-
| overlay_image_focus | oifo |
264-
| overlay_text | ot |
265-
| overlay_text_font_size | ots |
266-
| overlay_text_font_family | otf |
267-
| overlay_text_color | otc |
268-
| overlay_text_transparency | oa |
269-
| overlay_alpha | oa |
270-
| overlay_text_typography | ott |
271-
| overlay_background | obg |
272-
| overlay_text_encoded | ote |
273-
| overlay_text_width | otw |
274-
| overlay_text_background | otbg |
275-
| overlay_text_padding | otp |
276-
| overlay_text_inner_alignment | otia |
277-
| overlay_radius | or |
278320
| progressive | pr |
279321
| lossless | lo |
280322
| trim | t |

0 commit comments

Comments
 (0)