By default, WordPress compresses the pictures you for better performance. Below we will see how you can increase or decrease the compression of .jpeg images in WordPress.
Whenever you upload a jpeg image to WorPress, the software will compress it to the quality of 90%. From WorPress 4.5, this number decreased to 82% to improve website performance for mobile users.
Now that you are a photographer and you want to display high quality images on your website, you can turn off image compression on WorPress.
Let's see how:
All you need to do is copy and paste the code below into the archive functions.php. The file is in the theme you are using.
add_filter ( 'jpeg_quality', function ($ arg) {return 100;});
By setting the price to 100, you are sure that WordPress will compress the image to its highest quality.
If you are not a photographer, you probably will not see a big difference in quality. But for those who work with high-quality images on a daily basis, the difference in quality is obvious.
But let's see what we can do for those who are not photographers and are more interested in the performance of their website:
If you want, you can further reduce the number to earn a few kbs of each image you upload to your site.
Copy and paste the following code into the functions.php file:
add_filter ( 'jpeg_quality', function ($ arg) {return 75;});
After these changes to the image quality, you should run it Plugin Regenerate Thumbnails.