Optimized Quantization Method for Compressing Digital Images