I have a css containing filter for adding Grayout images in FF like this:-
filter: url(\"data:image/svg+xml;utf8,
I found out by experimenting with JW.'s idea that you can base64-encode the entire string, except for the final #grayscale
part and adding the corresponding encoding part, or, even nicer. only url-encode the spaces between xml attributes and/or tag names and separating the matrix values by commas.
So in the end you have:
filter: url("data:image/svg+xml;utf8,#grayscale");
which is compact and doesn't get altered by the css compressor