Filter means to remove, not to add. Like `filter()` in Python or Swift being given a condition and a list and returning everything that meets the condition.
In image processing "filtering" has for over 30 years meant any algorithmic manipulation of an image as a whole (exhibit A: Photoshop's "Filters" menu). Simplest filters are also filters in the signal processing sense, but the meaning in this context is considerably broader than that.
I reckon filters were initially intended to remove specific frequencies/noise and the term grew from there. Which is how ffmpeg and other software ended up with video filters that don't actually remove anything.
Someone else mentioned lens filters as a possible source for the term but I'm pretty sure the signal processing term is at least partially responsible for the current usage.
I ran into something similar with maven builds today. Filtering resources with maven means replacing text in the resource with text from maven properties.