Hypergraphs are a very powerful tool and can represent many problems. In this paper we define a new image representation based on hypergraphs. This representation conducts to a new lossless compression algorithm for images called HLC. We present the algorithm and give some experimental results proving its efficiency. Finally we show that this algorithm can be generalized to three-dimensional images and to parametric lossy compression.