We can use the Median filter to smoothen the edges of objects with a transparent background. Look at the following example of a rasterized object:

Object with rough edges

We can smoothen the edges of this object by selecting in the menu Filter / Noise / Median… and entering a value of 20 pixels:

Median correction

This works fine when the object only has one color, however with most objects that’s not the case (like in the example below) and that’s when we need to use a mask.

- First hold down the Ctrl key (command key on the Mac) and click on the object’s thumbnail in the layers palette (A) which will automatically select the complete object.

- Release the Ctrl key and click on the Create a Mask icon at the bottom of your layers palette to create a mask based on this selection (B). After this you will notice that the mask has a double border (C), which is exactly what we want if we want to apply the Median filter.

- Continue by applying the Median filter with a value of 20.

Object with of more than 1 color

And as a result the edges of the image will be smooth as shown in this example:

Object with smooth edges

A similar technique can be found in our Smoothen Edges tutorial.