• I understand WordPress creates smaller versions of the original image file.

    These versions are blurry in comparison to the original which is a big issue as a photographer.

    I set up this page you can see the difference https://www.jamieknop.com/test/

    How can I stop WordPress compressing the images?

    I tried adding the below to the functions.php file and regenerating the thumbnails but no luck.

    add_filter('jpeg_quality', function($arg){return 100;});

    Thanks,
    Jamie

Viewing 10 replies - 1 through 10 (of 10 total)
  • I found this thread but it doesn’t look to promising

    https://wordpress.org/support/topic/post-thumbnails-quality/

    • This reply was modified 7 years, 1 month ago by mrtom414.
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Your images are being uploaded in their raw quality, it’s probably just that the images are being squished into a smaller area using CSS and that’s a natural thing that happens

    Thread Starter jamiek47

    (@jamiek47)

    @anevins thanks for your reply. They are not being uploaded in raw, they are being uploaded as JPEG. It is nothing to do with CSS, it’s how WordPress is resizing/compressing the images.

    @mrtom414 thanks, though this will unfortunately not solve how WordPress is compressing the images.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    When I say raw, I mean, when I view your site and see the images, they are being uploaded as JPEG 2000px+ files. The reason they are smaller than 2000px is because they are being resized with CSS and when you resize any image smaller then you see a different quality.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    For instance this is one of the huge images that is being loaded directly on the page you’ve linked: https://www.jamieknop.com/wp-content/uploads/2019/09/product-photography-1.jpg

    It’s not being resized. If it were then the file name would be named differently.

    Thread Starter jamiek47

    (@jamiek47)

    @anevins they are not being resized with CSS, WordPress is generating these images from the original. e.g. https://www.jamieknop.com/wp-content/uploads/2019/09/product-photography-1-1-705×529.jpg

    How WordPress is resizing/compressing the images is the issue.

    Because the file dimensions are smaller should not deteriorate the quality/sharpness of an image.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I think I am misunderstanding the issue. The page you’ve linked above is not demonstrating the issue then; where would I be able to see the problem?

    wordpress resizes images in the functions.php file using a function called add_image size. When wordpress get the image size it uses the default size if one is not given in your setup. But, if you use the_post_thumbnail( ‘full’ ) or get_post_thumbnail(‘full’) it will use the image you uploaded and not the modified image. You would have to create a child theme and find the get_post_thumbnail() in your loop and change it to get_post_thumbnail(‘full’).

    Thread Starter jamiek47

    (@jamiek47)

    @anevins I have managed to solve this using a plugin called WP Retina 2x https://en-gb.wordpress.org/plugins/wp-retina-2x/

    Because my screens are retina, perhaps I was seeing them worse than they would appear on a normal screen.

    Thread Starter jamiek47

    (@jamiek47)

    @mrtom414 thanks, yes I believe that would also work πŸ™‚ see my last reply to @anevins which has helped resolve this.

    Thanks, both.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Stop WordPress compressing images? – Quality is terrible’ is closed to new replies.