Skip to content

Commit 99685a9

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
updated readme
1 parent bbc1525 commit 99685a9

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

README.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,29 @@ image_url = imagekit.url({
352352
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
353353
```
354354

355+
**5. Arithmetic expressions In transformations**
356+
357+
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.
358+
359+
For example:
360+
361+
```ruby
362+
image_url = imagekit.url({
363+
path: "/default-image.jpg",
364+
url_endpoint: "https://ik.imagekit.io/your_imagekit_id/endpoint/",
365+
transformation: [{
366+
width: "iw_div_4",
367+
height: "ih_div_2",
368+
border: "cw_mul_0.05_yellow"
369+
}]
370+
});
371+
```
372+
373+
**Sample Result URL**
374+
```
375+
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
376+
```
377+
355378
**List of transformations**
356379

357380
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.
@@ -364,10 +387,10 @@ If you want to generate transformations in your application and add them to the
364387
|-------------------------------|-------------------------|
365388
| height | h |
366389
| width | w |
367-
| aspectRatio | ar |
390+
| aspect_ratio | ar |
368391
| quality | q |
369392
| crop | c |
370-
| cropMode | cm |
393+
| crop_mode | cm |
371394
| x | x |
372395
| y | y |
373396
| focus | fo |
@@ -382,13 +405,15 @@ If you want to generate transformations in your application and add them to the
382405
| lossless | lo |
383406
| trim | t |
384407
| metadata | md |
385-
| colorProfile | cp |
386-
| defaultImage | di |
408+
| color_profile | cp |
409+
| default_image | di |
387410
| dpr | dpr |
388-
| effectSharpen | e-sharpen |
389-
| effectUSM | e-usm |
390-
| effectContrast | e-contrast |
391-
| effectGray | e-grayscale |
411+
| effect_sharpen | e-sharpen |
412+
| effect_usm | e-usm |
413+
| effect_contrast | e-contrast |
414+
| effect_gray | e-grayscale |
415+
| effect_shadow | e-shadow |
416+
| effect_gradient | e-gradient |
392417
| original | orig |
393418
| raw | `replaced by the parameter value` |
394419

0 commit comments

Comments
 (0)