I’ve optimized an image that is 1280px x 800px
in width/height and is 150kb
in file size. I have used add_image_size
to WordPress to make different thumbnail, small and large versions of the uploaded image. However, when WordPress sizes this image, it’s much bigger in file size despite being smaller! I get this:
/* I only specified widths because the images keep the same ratio */
IMAGE NAME WIDTH FILE SIZE
-------------- ------- ----------
my-small-size 480px 112kb
my-medium-size 768px 211kb
my-large-size 1280px 150kb (I uploaded this version)
I have installed imagick, but don’t know if WordPress is using it. Is there a way to improve the compression that WordPress uses?
EDIT: These are png
images.
The default quality when saving in WordPress is 90%.
If you want to change this, stick the following code in your functions.php for your theme:
This should affect all thumbnails generated by WordPress.
—
wp_editor_set_quality
is located in:jpeg_quality
is located in:Use JPEG images, that compress well. PNG will not help with compressing size when reducing the dimensions.