The Haar wavelet is a lossless compression approach, it is applied in several levels, at each level the size is reduced by a rate of 75%. This reduction produces degradations in the image quality, and consequently the loss of the content of the original image. The purpose of this article is to find the optimal level of compression, which means the level of compression that produces the smallest compressed image that retains the original image content.The search for the optimal level of compression will be based on a proposed system, this system contains two parts: the first part use the principle of Haar wavelets algorithm to produces the compressed images at several levels and the second part use a recognition system as a criterion control to detect and recognize the content of images.