1

Websites nowadays tend to have big banners and big images. Thus when developing sites we try to optimize these images as much as possible. However, when wordpress resizes these images, it does a terrible job at keeping the file size small.

For instance:

I have a 2400 x 1850 px image - at 384 kb (optimized) When wordpress resizes this image down 2048 x 1536 (using add_image_size()) the file size actually grows to over 1.5 MB.

Is there a way to change the settings, whether it's quality or sharpness of the resized image?

I know that there are other plugins out there that will optimize images for you, but most of them wont deal with large sizes unless you pay some monthly fee.

Other plugins only deal with lossless resizing. Which at 2400 pixel is not ideal. At 2400 pixels I can trade some loss in quality for smaller file sizes.

1 Answer 1

2

The file size increase you describe sounds odd. Are you referring to jpegs?

Anyway, you can control loss quality for jpegs. Add this to your functions file:

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

Replacing 80 with whatever percentage you would prefer.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.