The compression data problem is one of most important problems nowadays, because it saves storage requirements, and reduces the time for the processing, The compressed data give the returns of main data in few times. In this article, we offer an algorithm for recognizing the closed and unclosed shapes, and that was done by compressing the images using haar wavelet, and we noted that the compressed images give the wanted returns in about quarter the time that main images take. This algorithm was done using the Mathematica 8.0 program as one of the most powerful programming languages.