High quality model for compression of medical images in telemedicine