1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Finally I got rid of JPEG image compression in WordPress

Discussion in 'Blogging' started by antagonist, Jul 6, 2013.

  1. antagonist

    antagonist Registered Member

    Joined:
    Oct 15, 2012
    Messages:
    72
    Likes Received:
    26
    Boy, was I annoyed.

    I pretty much accepted the fact that WordPress reduces the uploaded image quality by default - which sucks because I like my images clean and crisp.

    Finally I found a neat little snippet to stop WordPress from reducing the image quality:

    Code:
    <?php add_filter('jpeg_quality', function($arg){return 100;}); ?>
    Put this into your functions.php and you're good.

    ~
    Credit goes to http://wp-snippets.com/keep-wordpress-from-compressing-jpgs/

    PS: It seems that you need PHP 5.3.1+ installed on your webserver to make this work.
     
  2. Moosey

    Moosey Senior Member

    Joined:
    Dec 5, 2011
    Messages:
    1,043
    Likes Received:
    747
    I like using png images, although the file size is much larger. If you have a solid cache plugin configured correctly it never becomes an issue from my experience.
     
    • Thanks Thanks x 1
  3. kindarthur

    kindarthur Jr. VIP Jr. VIP

    Joined:
    Nov 27, 2011
    Messages:
    2,212
    Likes Received:
    332
    Perfectly said!, I agree on you mate! @op Here, You can get the plugin,
    Check this out:http://wordpress.org/plugins/wp-resized-image-quality/

    You can change the compression level of uploaded JPEG images and thumbnails.

     
    • Thanks Thanks x 2
  4. SpookSEO

    SpookSEO Senior Member

    Joined:
    Dec 15, 2012
    Messages:
    848
    Likes Received:
    180
    Occupation:
    Linkbuilder
    Location:
    London, UK
    Home Page:
    I am also experiencing some troubles with regards to the quality of images in wordpress. Thank you for sharing this useful tip.
     
  5. antagonist

    antagonist Registered Member

    Joined:
    Oct 15, 2012
    Messages:
    72
    Likes Received:
    26
    Thanks mate. I have to admit I never thought about doing it with a plugin. And as it's really simple to implement the above snippet I will save the bandwidth for now.

    I like simple solutions and I really just needed to get rid of the annoying image quality reducing "feature" :)
     
  6. adamprattler

    adamprattler Junior Member

    Joined:
    Jun 28, 2013
    Messages:
    107
    Likes Received:
    14
    Home Page:
    Thanks mate, you helped me a lot. I was also looking for this jpg image solution in WP. It really works.
     
  7. coolboy113u

    coolboy113u Junior Member

    Joined:
    Oct 27, 2009
    Messages:
    160
    Likes Received:
    26
    Occupation:
    Web Designer & Developer, IPhone Developer
    Location:
    I live on the Internet :)
    that's cool. Now good luck configuring the CDN. Use cloudflare or similar services to make sure that it loads up quickly :)