There are two types of lens filters available: (1) general filters that are used to reproduce colors accurately; and (2) special effect filters that are used to create special photographic effects. Usually, the lens of the camera is equipped with a filter thread on the front frame to which you will attach the filter.
Most compact cameras, though, are not designed so a filter can be directly attached to the camera. But even in such case, with camera models that have wide-angle and tele conversion lenses, you can use the same adapter to attach a filter to the camera. Be sure to use the adapter designed specifically for the camera model. With small compact cameras that were not designed even for the use of adapters, you can get a similar effect by taking the picture holding the filter over the front of the lens.
Attaching a filter using the adapter for conversion lenses:
Holding the filter over the front of the lens: