This paper presents an improved block-based segmentation method for JPEG compressed document images, addressing the challenge of compression artifacts that negatively affect the quality of text and graphics. The proposed algorithm utilizes AC energy thresholding for background segmentation and K-means clustering for classifying text and picture blocks, demonstrating robustness across different quantization tables. Results show effective segmentation with consistent performance across various quality factors, suggesting its potential application to other image formats as well.