Encode filters in a way that can be read back out again