user
The median filter takes in the neighbourhood the median color (see Median filter)

*(to test the function below, you can use these input and output solutions)*
assistant
(formerly Perl 6)
Clone of Perl 5, for now.

```
use PDL:from<Perl5>;
use PDL::Image2D:from<Perl5>;

my $image = rpic 'plasma.png';
my $smoothed = med2d($image, ones(3,3), {Boundary => 'Truncate'});
wpic $smoothed, 'plasma_median.png';

```

Compare offsite images: plasma.png vs.
plasma\_median.png