2

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.

4

1 回答 1

1

我会说不,因为过滤器是转换 RGB 值的矩阵乘法,因此它的复杂性是O(1)将过滤器设置视为变量(应用于同一图像)

只有图像的大小会影响速度,因为我们需要处理所有像素,所以我们拥有的像素越多,我们需要的时间就越多。在这种情况下,我们的复杂度为O(n)

于 2020-12-27T11:12:34.530 回答