A new cost function, namely, the Wiener cost function, is introduced to find the best wavelet packet (WP) base in image denoising. Unlike the existing entropy-type cost functions in image compression, the Wiener cost function depends on both sparseness of image representation and noise level. Combining the Wiener cost function and the doubly local Wiener filtering scheme, a new image denoising algorithm is proposed using the best wavelet packet bases. Owing to unknown true image in denoising, a pilot image with less noise is required to find the best wavelet packet base, which is obtained by the existing denoising algorithms. From the pilot image, the best 2D wavelet packet tree is searched in terms of the Wiener cost function and the energy distributions of the image in the best wavelet packet domain are also estimated. Further, the image is recovered by applying the local Wiener filtering to the best wavelet packet coefficients of the noisy image. The experimental results show that for images of structural textures, for example 'Barbara' and texture images, the proposed algorithm greatly improves denoising performance as compared with the existing state-of-the-art algorithms.