Fixed Prevent stripping of ICC color profiles when using ImageMagick


Well-known member
JPG and other formats can contain ICC color profile data in the EXIF data. Web browsers use this data to render the image with more precise color matching. Without the color profile data, there can be a noticeable difference in the appearance of the picture.

php's built-in gd library does not support preserving color profiles when resaving, but ImageMagick does!

If the following part of XenForo_Image_ImageMagick_Pecl:: output() is changed:

to this:
$profiles = $this->_image->getImageProfiles('icc', true);


if (!empty($profiles))
    $this->_image->profileImage('icc', $profiles['icc']);

then the color profile will be saved and we won't have washed out looking images for some of our important attachments.


Sample images with icc profiles: (via this site) (via this site)
Last edited:


XenForo developer
Staff member
I've adjusted this now. It's easier to see if you take a ridiculous example: When resizing, the first "image" should come out cyan rather than grey if the ICC profile is kept. In reality, it generally just makes an image appear flatter.

I'd assume most people who export photos for the web would use sRGB, but clearly that doesn't always happen.