Images are dull after optimising for web

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
just kemp
Posts: 3
Joined: 2017-08-04T03:42:30-07:00
Authentication code: 1151

Images are dull after optimising for web

Post by just kemp »

Hi,

I'm currently trying to optimise some jpgs for our website. But something in the optimisation processes is causing the images to become dull.

I've tried using ImageOptimizer with OptimalCompression set to true -> results in dull image

Also tried MagickImage with Strip() option -> results in dull image

However MagickImage with just the quality changed and no Strip() leaves the image with the original colours.

So the strip is removing something that affects the hue? or intensity of the colours.

Is this a known issue, if so is there a way to work with ImageOptimizer.OptimalCompression without the colour intensity loss?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Images are dull after optimising for web

Post by snibgo »

What version IM? On what platform? Sample image?

If "-strip" changes colours, then something that was stripped was essential. I would guess this is a colorspace. Perhaps the image was in AdobeRGB, and the "-strip" discards that metadata. A better action would be to convert it to sRGB.
snibgo's IM pages: im.snibgo.com
just kemp
Posts: 3
Joined: 2017-08-04T03:42:30-07:00
Authentication code: 1151

Re: Images are dull after optimising for web

Post by just kemp »

sorry for the late reply, I hadn't set it to notify me.

I've checked the colorspace and it says sRGB, I'm using Magick.NET-Q16-AnyCPU Version 7.

A copy of the image is here: https://www.vouchercodeocean.co.uk/imag ... ts/org.jpg and here: https://www.vouchercodeocean.co.uk/imag ... /strip.jpg
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Images are dull after optimising for web

Post by snibgo »

"identify -verbose" says it has an embedded AdobeRGB profile. This is metadata that says what the pixel numbers mean. When you "strip" the profile, software will assume the encoding is sRGB, but it isn't.

The cure is: don't strip, or convert to sRGB (eg with "-profile sRGB.icc") before stripping.
snibgo's IM pages: im.snibgo.com
just kemp
Posts: 3
Joined: 2017-08-04T03:42:30-07:00
Authentication code: 1151

Re: Images are dull after optimising for web

Post by just kemp »

Thanks I've updated my c# code to keep that and looks much better now!
Post Reply