Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ANKUR DWIVEDI authored and ANKUR DWIVEDI committed Jan 18, 2024
1 parent bbc1525 commit 99685a9
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,29 @@ image_url = imagekit.url({
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
```

**5. Arithmetic expressions In transformations**

ImageKit allows use of [arithmetic expressions](https://docs.imagekit.io/features/arithmetic-expressions-in-transformations) in certain dimension and position-related parameters, making media transformations more flexible and dynamic.

For example:

```ruby
image_url = imagekit.url({
path: "/default-image.jpg",
url_endpoint: "https://ik.imagekit.io/your_imagekit_id/endpoint/",
transformation: [{
width: "iw_div_4",
height: "ih_div_2",
border: "cw_mul_0.05_yellow"
}]
});
```

**Sample Result URL**
```
https://ik.imagekit.io/your_imagekit_id/default-image.jpg?tr=w-iw_div_4,h-ih_div_2,b-cw_mul_0.05_yellow
```

**List of transformations**

The complete list of transformations supported and their usage in ImageKit can be found [here](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations). The SDK gives a name to each transformation parameter, making the code simpler, making the code simpler, and readable.
Expand All @@ -364,10 +387,10 @@ If you want to generate transformations in your application and add them to the
|-------------------------------|-------------------------|
| height | h |
| width | w |
| aspectRatio | ar |
| aspect_ratio | ar |
| quality | q |
| crop | c |
| cropMode | cm |
| crop_mode | cm |
| x | x |
| y | y |
| focus | fo |
Expand All @@ -382,13 +405,15 @@ If you want to generate transformations in your application and add them to the
| lossless | lo |
| trim | t |
| metadata | md |
| colorProfile | cp |
| defaultImage | di |
| color_profile | cp |
| default_image | di |
| dpr | dpr |
| effectSharpen | e-sharpen |
| effectUSM | e-usm |
| effectContrast | e-contrast |
| effectGray | e-grayscale |
| effect_sharpen | e-sharpen |
| effect_usm | e-usm |
| effect_contrast | e-contrast |
| effect_gray | e-grayscale |
| effect_shadow | e-shadow |
| effect_gradient | e-gradient |
| original | orig |
| raw | `replaced by the parameter value` |

Expand Down

0 comments on commit 99685a9

Please sign in to comment.