Too much compression on JPG images

I’m getting too much compression on JPG images even that super-smush is not enabled on my site. I upload 1200x350 images and create 1200x349 thumbnail during upload (to force smushing), but the compression is too high.

I contacted you a few months ago because I was getting this kind of problem with the super-smush option turned on so we turned it off, but I’m still getting lossy compression on any new uploaded image, not sure why.

Have you changed something in your compression tools over the past few weeks?

  • Adam Czajczyk

    Hello webmaster

    As long as you don't have super-smush enabled and are not using auto-conversion from PNG to JPEG (which does perform lossy conversion), Smush shouldn't be affecting quality here as it's only supposed to strip "visually irrelevant" data from image (that's why with super-smush option disabled the savings on file sizes are way smaller in most cases).

    However, WordPress itself also sets a quality of JPG files and it's not 100%. While WP is creating thumbnails of various sizes it's essentially creating new images out of existing ones. JPEG itself is a "lossy" format so creating one out of another - with quality set to less than 100% - might in some rare cases lead to some decrease of the quality.

    That being said, while we're waiting for our developers consultation on this, could you please try one small "trick"? Here's how:

    - create an empty file with a php extension (e.g. "fix-wp-jpge-quality.php")
    - copy and paste following code into that file:

    add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );

    - save the file and upload it to the "/wp-content/mu-plugins" folder of your WP install; if there's no "mu-plugins" folder inside "wp-content" folder, just create one.

    You will most likely need to regenerate thumbnails after that (e..g using Force Regenerate Thumbnails plugin from plugin repository) and clear caches but that would set jpeg quality to 100% and should improve it.

    I would, however, recommend testing it first on some staging/dev site before applying to a production one.

    Kind regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.