There is no need to undo anything. A "filter" indicates one of five possible error prediction filters used internally by the PNG encoding algorithm. The decoder detects this (the stream includes information about which filter was used for each line), and it can decode the image and that's it. You may think of the “filter” as some kind of image processing, but it’s not, it does not change the image at all.
source
share