Implemented cartoon filter.

Implemented a function that filters an image in a similar way as the
cartoon filter in GIMP.