Skip to content

Commit fbd63f0

Browse files
committed
docs: update README to clarify overlay options and improve encoding descriptions
1 parent 45d8a87 commit fbd63f0

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ Download a specific version:
5454
```
5555
https://unpkg.com/[email protected]/dist/imagekit.min.js
5656
```
57-
Or for the latest version, remove the version number:
57+
Or for the latest version, remove the version number (don't use in production as it may break your code if a new major version is released):
5858
```
5959
https://unpkg.com/imagekit-javascript/dist/imagekit.min.js
6060
```
61+
6162
And include it in your HTML:
6263
```html
6364
<script type="text/javascript" src="https://unpkg.com/imagekit-javascript/dist/imagekit.min.js"></script>
@@ -250,6 +251,8 @@ var solidColorOverlayURL = imagekit.url({
250251

251252
##### Overlay Options
252253

254+
ImageKit supports various overlay types, including text, image, video, subtitle, and solid color overlays. Each overlay type has specific configuration options to customize the overlay appearance and behavior. To learn more about how overlays work, refer to the [ImageKit documentation](https://imagekit.io/docs/transformations#overlay-using-layers).
255+
253256
The table below outlines the available overlay configuration options:
254257

255258
| Option | Description | Example |
@@ -260,8 +263,8 @@ The table below outlines the available overlay configuration options:
260263
| color | (For solidColor overlays) RGB/RGBA hex code or color name for the overlay color. | `color: "FF0000"` |
261264
| encoding | Defines how the overlay input is encoded. Accepted values: `auto`, `plain`, `base64`. | `encoding: "auto"` |
262265
| transformation | An array of transformation objects to style the overlay. <br> - [Text Overlay Transformations](#text-overlay-transformations) <br> - [Subtitle Overlay Transformations](#subtitle-overlay-transformations) <br> - Image and video overlays support most [transformations](#supported-transformations). <br> See [ImageKit docs](https://imagekit.io/docs/transformations#overlay-using-layers) for more details. | `transformation: [{ fontSize: 50 }]` |
263-
| position | Sets the overlay’s position relative to the base asset. Accepts an object with `x`, `y`, or `focus` (e.g., `center`). | `position: { x: 10, y: 20 }` or `position: { focus: "center" }` |
264-
| timing | (When base is a video) Defines when the overlay appears. Accepts an object with `start`, `duration`, and `end` properties (in seconds). | `timing: { start: 5, duration: 10 }` |
266+
| position | Sets the overlay’s position relative to the base asset. Accepts an object with `x`, `y`, or `focus`. The `focus` value can be one of: `center`, `top`, `left`, `bottom`, `right`, `top_left`, `top_right`, `bottom_left`, or `bottom_right`. | `position: { x: 10, y: 20 }` or `position: { focus: "center" }` |
267+
| timing | (For video base) Specifies when the overlay appears using `start`, `duration`, and `end` (in seconds); if both `duration` and `end` are set, `duration` is ignored. | `timing: { start: 5, duration: 10 }` |
265268

266269

267270
##### Encoding Options
@@ -280,14 +283,6 @@ For image, video, and subtitle overlays:
280283

281284
Use `auto` for most cases to let the SDK optimize encoding, and use `plain` or `base64` when a specific encoding method is required.
282285

283-
Below is a table describing these options:
284-
285-
| Option | Description | Use Case |
286-
| -------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
287-
| `auto` | SDK automatically selects between plain and base64 encoding based on the input. | Best for most cases when unsure or input is simple. |
288-
| `plain` | SDK treats the input as plain text. | Use for inputs that are already URL-safe. |
289-
| `base64` | SDK encodes the input using Base64 to ensure URL safety when special characters are present. | Use for complex inputs with characters that require encoding. |
290-
291286
##### Solid Color Overlay Transformations
292287

293288
| Option | Description | Example |
@@ -327,8 +322,6 @@ Below is a table describing these options:
327322
| `fontOutline` | Specifies the font outline for subtitles. Requires the outline width (an integer) and the outline color (as a standard color name, RGB, or RGBA) separated by an underscore. Examples include `2_blue`, `2_A1CCDD`, or `2_A1CCDD50`. | `fontOutline: "2_blue"` |
328323
| `fontShadow` | Specifies the font shadow for subtitles. Requires the shadow color (as a standard color name, RGB, or RGBA) and a shadow indent (an integer) separated by an underscore. Examples: `blue_2`, `A1CCDD_3`, or `A1CCDD50_3`. | `fontShadow: "blue_2"` |
329324

330-
For image and video overlay transformation options, refer to the [ImageKit Transformations Documentation](https://imagekit.io/docs/transformations).
331-
332325
#### AI and Advanced Transformations
333326
*Background Removal:*
334327
```js

0 commit comments

Comments
 (0)