Congratulations for your excelent work Aali. I still remember the summer tried doing something like this. And failed miserably
(as some may remember).
The way I see this, the only way of filetring the backgrounds correctly (without all those green, black, red, etc artifacts) would be filtering the whole image (with all layers applied). Of course, this is problematic. I'd say there are 3 cases regarding the backgrounds:
-Standard static backrounds. Applying the filter directly should suffice.
-Animated backgrounds. You should filter the whole background with every frame of the animation applied. Then save the animated tiles where they belong.
-I think there are some backgrounds that had sliding layers. That would be more troublesome. This would need not only a good filtering, but also a good deal of patience cutting off manually the edges of the layers.