Re: [css-images] Gamma errors in image downscaling

On Mon, Nov 10, 2014 at 10:05 PM, Lea Verou <lea@verou.me> wrote:

> On Nov 10, 2014, at 16:00, Rik Cabanier <cabanier@gmail.com> wrote:
>
> If you're creating patterns and other vector shapes, the solution is to
> express them natively in either CSS or SVG.
> Pixel scaling vector artwork is not something we should spend time fixing.
>
>
> 1. Authors do not always have full control over which images they have to
> use, the bitmap image might be given to them and vectorizing raster images
> is non-trivial.
> 2. The pattern may appear as part of a photo that was added later. Again,
> you are assuming that authors always create the images they use themselves.
> 3. As proven by the link in the first post, sometimes such cases occur
> organically in photos as well (e.g. check the saturn photo, the fly photo
> and all the other examples).
>

I'm still unconvinced that this is a problem worth solving. Do you have an
actual case where this was an issue?
I did some more research and found a couple of places that mention this
problem [1][2]

Inventing yet another do-this-linearly feature would be unfortunate.
We already have 2 properties for filters and compositing. It's also needed
for gradients, AA and now image scaling.

All this applying and removing of gamma will be very slow and destroy gray
values. It also results in messy code in the browsers because they will
have to special case each feature.
The correct solution is to teach the browser to do everything in a linear
colorspace.
Basically, colors would be transformed to the linear colorspace and the
browser's rendering engine would work as it does today. Then as the final
step, the result is transformed to the screen's colorspace.

1: http://entropymine.com/imageworsener/gamma/
2:
http://en.wikipedia.org/wiki/Spatial_anti-aliasing#Anti-aliasing_and_gamma_compression

Received on Tuesday, 11 November 2014 19:04:56 UTC