This paper presents a data hiding scheme that hides the data in the compression domain of a digital image. A quadtree decomposition algorithm decomposes the host image into blocks of variable sizes according to histogram analysis of the block residuals. Variable block sizes are then encoded at different rates based on their visual activity levels. The majority of secrete data are embedded into the smooth area of the image, while a small portion of the secret data are hidden in the compression codes of the high detailed blocks. Experimental results confirm that the proposed scheme can embed a large amount of data in the compressed file while maintaining satisfactory image quality.