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 » 2017-08-04T03:54:14-07:00

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: 9406
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 » 2017-08-04T05:06:51-07:00

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 » 2017-08-06T11:29:51-07:00

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: 9406
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 » 2017-08-06T14:29:48-07:00

"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 » 2017-08-07T02:23:37-07:00

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

Post Reply