on wordpress image resizing

WordPress 2.5 comes with a fantastic media manager, offering the ability to automatically resize an uploaded image into thumbnail and medium sizes as well as offering the original file. I’ve used this feature a bunch, both on this blog and my photoblog. I didn’t really think much of it, but just noticed today that the resized images were much less saturated than the originals. Here is a comparison of the same image, one resized by WordPress 2.5.1 (left), the other by Preview.app (right):

The shift in saturation is pretty obvious. For some images, it wouldn’t be a big deal. But I want to use WordPress to manage the files in my photoblog, so fracking up the saturation of a photograph is pretty bad. I spent about an hour trying to figure out how to convince the PHP image resizing code to not suck the soul out of the images. No can do.

The easy fix? Just use the “original size” option so WordPress doesn’t mess with the file, and resize it before uploading. I’ll be using Aperture to pump out 800 pixel wide photographs before uploading them to mindfulseeing.com

16 thoughts on “on wordpress image resizing

  1. I was using Flickr, but wanted to change for a couple of reasons. First (and most importantly) is that Flickr only give you 5 sizes to use – tiny, small, 500px, 1024px, and Original. I wanted to use images 800px across… Second, I wanted to host the images myself. If I’m building up a photoblog, it shouldn’t be dependent on my continuing to pay Flickr each year (which I likely WILL, but I don’t want the added dependency). I could just use Flickr itself, without running a separate blog, if I were to do that.

  2. Alex suspects it’s a PHP GD bug, it ignores or strips the colour profile when resizing. It would be great if you report it to http://trac.wordpress.org/ with example input image, actual result and expected result example images. Probably hard to fix, but it would be great to get it on the books.

  3. @lloyd – your comment got yanked as spam by Akismet ๐Ÿ™‚ I held off filing a bug because there are so many parts in the chain that could be causing it, and it might just _look_ like it’s WordPress that’s doing it. There could be something fishy with GD on my server, or something in the config of PHP, etc… I’ll try to track it down a bit more and then try to file something helpful ๐Ÿ™‚

  4. @lloyd I look in my Akismet spam bucket daily because there are often posts that get mislabeled as Spam (like yours…)

    I still haven’t had a chance to dig deeper, but will file when I get the chance. I’ve also got another one that I should file on the fancy new media uploader misbehaving when using the “full size” option (it forces a 500px width value in the HTML, regardless of actual image size…)

  5. I am seeing precisely the same issue – with saturation shift (consistently to lower saturation) – in resized images – in my Gallery2 installation. I’ve tried re-ordering the priority of graphics toolkits (I have GD, ImageMagic and NetPBM configured), and the priority given to these appears to have no effect on this.

    The issue can be worked around by resizing images prior to upload, but then I cannot simply use the รœbermind “GalleryExport for iPhoto” iPhoto plugin to interact with my Gallery2 installation.

    I’m not anywheres near the photographer that you are, but even for my simpler needs the degradation of quality here is an issue.

    Has anyone identified the issue here, and a fix (rather than a workaround) for it?

    will taylor

  6. I’d noticed this problem as well, which is a real bummer considering it so drastically reduces the photo quality. I’m hoping there’ll be a fix to this problem in an upcoming update.

  7. Try to stick to the sRGB color space. You’re probably uploading images directly from your camera, and they might be in Adobe RGB color space, and browsers only interpret sRGB correctly.

    You should be able to correct this either with photoshop, or amth like irfan view.

    1. so, the workflow to avoid having to resize images in Photoshop before uploading, is to change color spaces in Photoshop before uploading. That’s really not a solution, that’s an alternate hack.

      1. or you can set it in the camera. dunno, it’s worth a shot.
        Try uploading an sRGB one and and an Adobe RGB one, and let us know if there’s any change.

Comments are closed.