Cwe
March 8, 2017, 4:18pm
1
Enonic version: 6.9.2
OS: Mac OSX and Linux
Would something like this work on a SVG (forced into a JPG):
imageUrl({format: ?, filter:‘grayscale()’})
http://xp.readthedocs.io/en/stable/reference/view-functions/imageUrl.html?highlight=format
tsi
March 9, 2017, 7:46am
2
I guess it could in the future, but right now svg’s are not supported by the image service. There are interesting uses cases for turning svg’s into rastered images
bhj
March 9, 2017, 7:52am
3
@cwe , you can apply SVG filters on top of IMG elements, so I guess the same would work on top of SVG elements as well?
Example of grayscale IMG using an SVG filter:
http://jsfiddle.net/KDtAX/487/
tlo
March 9, 2017, 8:14am
4
I can confirm that CSS grayscale filters works on SVG.
1 Like
Cwe
March 9, 2017, 8:42am
5
Have you tried in IE11 Cause they removed the old way of doing grayscale, and have not added support for CSS3 filters yet.
tlo
March 9, 2017, 8:44am
6
Haven’t tried in IE11, but there should be workarounds, such as this: http://www.majas-lapu-izstrade.lv/cross-browser-grayscale-ie11/