How to convert fabric filter values of version 1.x to 4.x #6760
Replies: 4 comments 3 replies
-
There are suggestions on fabricjs.com on how to deal with it. I would suggest you for your own peace of mind to just move to the same version everywhere. |
Beta Was this translation helpful? Give feedback.
-
We are planning to move to the latest version before that we need check, if we are able to convert the 1.x values to 4.x. Sorry for sub threading. |
Beta Was this translation helpful? Give feedback.
-
Noise does not have a 1:1 match being a random effect, sadly, but for blur we can fix it. |
Beta Was this translation helpful? Give feedback.
-
Okay, Please add solution for blur. All filters are working fine, but saturation/100 not works for me, but saturation/255 gives closest results for me. |
Beta Was this translation helpful? Give feedback.
-
I am using fabric Js version 1.6.4 on canvas, but I am using fabric Js version 4.x while preview the large size.
Filters such as Blur, Brightness, Noise, Hue, Saturation and Contrast values are range from 1 to 100 in fabric 1.x. How to convert this values to 4.x filter values which is ranging between 0 and 1 or -1 and 1. However I have managed to convert few filters by referring this .
For example:
However I am not able to convert Noise using the above calculations, because Noise filter is ranging between 100 to 1000 in 4.x.
I have tried doing like the following.
But it is not working as expected, However following method gives the closest result, but it is not officially documented, I have assumed the multiplier of 200.
Please refer if any other official doc is out there for all filter conversions.
Beta Was this translation helpful? Give feedback.
All reactions