Skip to content

Commit 2485020

Browse files
committed
docs: update README to include overlay options and configuration details
1 parent f910510 commit 2485020

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Lightweight JavaScript SDK for generating optimized URLs for images and videos,
1818
- [URL Generation](#url-generation)
1919
- [Basic URL Generation](#basic-url-generation)
2020
- [Advanced URL Generation Examples](#advanced-url-generation-examples)
21+
- [Chained Transformations](#chained-transformations)
22+
- [Overlays and Effects](#overlays-and-effects)
23+
- [AI and Advanced Transformations](#ai-and-advanced-transformations)
24+
- [Arithmetic Expressions in Transformations](#arithmetic-expressions-in-transformations)
2125
- [Supported Transformations](#supported-transformations)
2226
- [Handling Unsupported Transformations](#handling-unsupported-transformations)
2327
- [File Upload](#file-upload)
@@ -244,6 +248,18 @@ var solidColorOverlayURL = imagekit.url({
244248
});
245249
```
246250

251+
**Overlay Options**
252+
253+
The following table details the overlay configuration options as defined in the SDK. These options are passed in the overlay object and directly map to URL parameters:
254+
255+
| option | Description | Example |
256+
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
257+
| encoding | Specifies how the overlay input is encoded. The default is "auto", meaning the SDK automatically determines whether to use plain (`i-{input}`) or base64 (`ie-{base64_encoded_input}`) encoding based on the content. You can explicitly set it to "plain" or "base64". | `encoding: "plain"` |
258+
| position | Defines the overlay's placement relative to the parent asset. Accepts a JSON object with properties: `x` and `y` for coordinates (which can be arithmetic expressions) or a `focus` value such as "center", "top_left", etc. | `position: { x: 10, y: 20, focus: "center" }` |
259+
| timing | When the base asset is video, specifies when the overlay appears. It accepts a JSON object with values for `start`, `duration`, and `end`. If both `duration` and `end` are provided, `duration` is ignored. | `timing: { start: 5, duration: 10, end: 15 }` |
260+
261+
These options provide developers with fine-grained control over overlay transformations, ensuring that the generated URL accurately reflects the desired overlay configuration.
262+
247263
#### AI and Advanced Transformations
248264
*Background Removal:*
249265
```js

0 commit comments

Comments
 (0)