Are uploaded images on your WordPress blog look less crisp than original photos? By default, WordPress reduces quality of images during upload process. This is done to reduce image size, which also reduces time taken to download those images while viewing blog posts.

Default image quality setting is 90% in WordPress setup. Which means, quality of  images is reduced by 10% once they are uploaded.

Code to change Image Quality setting to 100%

You can bypass this and make WordPress upload 100% quality for images by using following code in functions.php file.

[cc lang=”php”]
add_filter(‘jpeg_quality’, ‘jpeg_quality_callback’);
function jpeg_quality_callback($arg) {
return (int)100;
}
[/cc]

If use Tim Thumb for image resizing and thumbnails generation, then you need to modify settings in Tim Thumb file. Open thumb.php file located in functions folder and then change 90 to 100 as in code below.

[cc lang=”php”]
if(! defined(‘DEFAULT_Q’) ) define (‘DEFAULT_Q’, 90); // Default image quality. Allow override in timthumb-config.php
[/cc]

Above will change image quality to 100% setting but will also result is bigger sized image files which may take more time to download. Quality and file size – trade off is always involved! [Credit Nuwomb]

Use Disable JPEG Compression plugin

Disable JPEG plugin is another option if you do not like to mess with manual code editing. This is very small plugin (just one line) that restores JPEG image quality to 100% by disabling default compression done by WordPress.

Davinder Singh Kainth

A digital creator with 15+ years of experience in Website Design, Development, SEO, and Content Creation to Podcasting at SmartWebCreators.com with the motto of "Be Smart, Keep Creating". A coach, consultant, and your dear geek friend ❖

Leave a Comment