PET images that have been reconstructed with unregularized algorithms are commonly smoothed with linear Gaussian filters to control noise. Since these filters are spatially invariant, they degrade feature contrast in the image, compromising lesion detectability. Edge-preserving smoothing filters can differentially preserve edges and features while smoothing noise. These filters assume spatially uniform noise models. However, the noise in PET images is spatially variant, approximately following a Poisson behavior. Therefore, different regions of a PET image need smoothing by different amounts. In this work, we introduce an adaptive filter, based on anisotropic diffusion, designed specifically to overcome this problem. In this algorithm, the diffusion is varied according to a local estimate of the noise using either the local median or the grayscale image opening to weight the conductance parameter. The algorithm is thus tailored to the task of smoothing PET images, or any image with Poisson-like noise characteristics, by adapting itself to varying noise while preserving significant features in the image. This filter was compared with Gaussian smoothing and a representative anisotropic diffusion method using three quantitative task-relevant metrics calculated on simulated PET images with lesions in the lung and liver. The contrast gain and noise ratio metrics were used to measure the ability to do accurate quantitation; the Channelized Hotelling Observer lesion detectability index was used to quantify lesion detectability. The adaptive filter improved the signal-to-noise ratio by more than 45% and lesion detectability by more than 55% over the Gaussian filter while producing "natural" looking images and consistent image quality across different anatomical regions.