1. A method of compressing an input image, using at least one processor, the method comprising: verifying, using the at least one processor, a desired compression quality value for compressing the input image; determining, using the at least one processor, an optimal image quality value corresponding to a target peak signal-to-noise ratio (PSNR) from an image quality range based on the desired compression quality value; and outputting, using the at least one processor, an image file encoded at the determined optimal image quality value as a compressed file of the input image.