Adaptively smoothing astronomical images with ADAPTSMOOTH