[Compress Resize Image] Compress - Quality Values

[Compress Resize Image] Compress - Quality Values

Forge Component
Published on 2017-12-12 by Sachin Mahawar
5 votes
Published on 2017-12-12 by Sachin Mahawar

To compress image it required a Quality Value. Is there any range?, a big number means more compression or less qualiyy?

Hi Carlos,

        /// </summary>
        /// <param name="path">Path to which the image would be saved.</param>
        // <param name="quality">An integer from 0 to 100, with 100 being the
        /// highest quality</param>
        // public static void SaveJpeg(string path, System.Drawing.Image img, int quality)

Hi Carlos and Fábio,

From my experience, we must take into account the type of image that we are compressing.If your objective is decrease size and if the format from image is Jpeg, depends from image and the quality value that you will passe. When I did this, I converted the images to webp format and in this format do not exist this problem and the image is very compressed without lose quality.