Some custom filter kernel to average out values from a chunk of pixels with some kind of “border aware” behaviour?