In CSS, is filter: saturate(100) any slower than saturate(2)?

186 Views Asked by At

For CSS filters, would there be any difference is the browser's speed to process saturate(2) as compared to any of the following:

saturate(100)
saturate(1000)
saturate(9999)
saturate(56.789)
saturate(0.001)
saturate(0.1)
saturate(0.5)
saturate(0.6789)

I am just using saturate as an example here. Interested in learning the answer for all CSS filters.

1

There are 1 best solutions below

2
On

I would say no since a filter is a matrix multiplication that transform RGB values so its complexity is O(1) considering the filter setting as a variable (applied to the same image)

Only the size of the image should affect the speed since we need to proceed all the pixels so the more pixel we have the more time we need. In this case we have a complexity of O(n)