This paper consists of a lossy image compression algorithm dedicated to the medical images doing comparison of RGB and YCbCr color space. Several lossy/lossless transform coding techniques are used for medical image compression. Discrete Wavelet Transform (DWT) is one such widely used technique. After a preprocessing step (remove the mean and RGB to YCbCr transformation), the DWT is applied and followed by the bisection method including thresholding, the quantization, dequantization, the Inverse Discrete Wavelet Transform (IDWT), YCbCr to RGB transform of mean recovering. To obtain the best compression ratio (CR), the next step encoding algorithm is used for compressing the input medical image into three matrices and forward to DWT block a corresponding containing the maximum possible of run of zeros at its end. The last step decoding algorithm is used to decompress the image using IDWT that is applied to get three matrices of medical image.