- From: Nicolas Robidoux <nicolas.robidoux@gmail.com>
- Date: Wed, 27 Feb 2013 19:52:12 -0500
- To: "www-style@w3.org" <www-style@w3.org>
- Message-ID: <CAGZHQLwEMRh_VQQsg3mu_sdm=WXw6ann7maEuMG79AzHFZvv8g@mail.gmail.com>
ImageMagick, which used to create gradients in non pre-multiplied light, has been creating gradients with pre-multiplied light for a long time now, for the usual reason:http://www.imagemagick.org/Usage/canvas/#gradient_transparent The exact same issue occurs when resampling. By default, resampling is now performed in pre-multiplied light in ImageMagick. I myself was initially surprised by this decision of Anthony Thyssen. But I now agree: http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=22287. As a result, I set up the GEGL library (the new high bit depth engine of GIMP) so that it does all resampling in pre-multiplied light as well. Gradients, however, are a rather mild application of resampling. When used with a constant background, the difference between non-pre and pre is proportional to the product of the "slope" defined by the colour change times the "slope" defined by the transparency change. As a result, with a constant background, there is no difference between the two when at least one of the transparency or the colour is constant, and when the background, the colours, and the transparency varies slowly, offensive artifacts are generally not that offensive. (This is different than the issue of reproducibility.) For this reason, although pre-multiplied gives better results, I am not sure that imposing it on developers is necessarily a "win". I have not considered this issue carefully in the context of CSS. Take the above more as a "data point" than an intended prescription. -- Nicolas Robidoux Image processing and applied mathematics consultant https://www.ohloh.net/accounts/NicolasRobidoux http://river-valley.tv/better-and-faster-image-resizing-and-resampling http://www.imagemagick.org/Usage/filter/nicolas
Received on Thursday, 28 February 2013 07:37:52 UTC