WordPress image quality

Improve WordPress default image quality

It’s well known that a picture says more than 1000 words so there are many webmasters or site owners who are using thousands of images at the site. Still there are people like artists or photographers who want to show off their work and use many images. Of-course that they want to show them in great quality, but WordPress by default cut the quality to 90%. The whole idea of compressing images is here to help your pages load faster and keep file sizes smaller. Anyway if you still miss that extra 10% this is topic for you. Let me explain you a thing!

First of all there are two elementary image extensions we use daily and these are JPG and PNG. Differences are enormous and let me show you why.The most common image extensions used online is JPG, mostly because they can apply heavy layers of compression and in process page will load faster. That’s great for your page visitors and also for SEO. But in process of compression you lose some of the picture quality which could be issue for you. PNG or (Portable Network Graphics) extension have much larger files and of-course have better quality, but problem is that your page will load a little bit slower.

No matter how much time you duplicate save and re-upload PNG’s with your WordPress images will keep quality witch is opposite to JPG. PNG’s also support palette-based images with palettes of 24-bit RGB or 32-bit RGBA colors, images with or without alpha channel and full-color non-palette-based RGB images…

Why and when you should improve image quality?

WordPress image quality
There are three images the one of the left 100% quality, middle one 90% and right at 80%.

When you upload image in WordPress post it’s clearly visible that quality of image is downgraded and we all wonder why is that happening. Simply WordPress create a thumbnail so you can use it again in later.

If you are an artist or photographer or for any other reason you wish to improve your image quality here is a snippet witch you can add bellow to your theme’s functions.php or you can simply made it trough free plugin.

You are right, this snippet is allowing you to control quality of uploaded images or to save bandwidth if you wish. You can change the JPEG compression-level of images simply by editing return (int)100; part of the function.

Improve WordPress default image quality

[php]
/**
* Snippet Name: Improve WordPress default image quality
* Snippet URL: http://wperror.com/improve-wordpress-default-image-quality.html
*/
function wpe_jpeg_quality_callback($arg)
{
return (int)100;// change 100 to whatever you prefer!
}

add_filter(‘jpeg_quality’, ‘wpe_jpeg_quality_callback’);
[/php]

One thought on “Improve WordPress default image quality”

Leave a Reply to admin Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>