W3C home > Mailing lists > Public > www-svg@w3.org > February 2011

Re: SVG masks and luminance calculations

From: Erik Dahlstrom <ed@opera.com>
Date: Fri, 04 Feb 2011 13:04:42 +0100
To: "Boris Zbarsky" <bzbarsky@mit.edu>, "Tavmjong Bah" <tavmjong@free.fr>
Cc: "Dirk Schulze" <vbs85@gmx.de>, www-svg@w3.org, "Robert Longson" <longsonr@gmail.com>
Message-ID: <op.vqdnt1pngeuyw5@localhost>
On Thu, 03 Feb 2011 16:57:45 +0100, Tavmjong Bah <tavmjong@free.fr> wrote:

> On Thu, 2011-02-03 at 10:09 -0500, Boris Zbarsky wrote:
>> On 2/3/11 4:39 AM, Dirk Schulze wrote:
>> > The most(unsure about Safari/Win) ports of WebKit use linearRGB as  
>> default now
>>
>> As far as I can tell, Safari/Mac uses linearRGB and Safari/Windows uses
>> sRGB (which certainly confused the person who reported a bug on us).
>> Chrome uses linearRGB, in my experiments.  Gecko uses linearRGB.
>>
>> Also, Inkscape apparently uses sRGB while Batik uses linearRGB, for what
>> that's worth.
>
> Inkscape does use sRGB at the moment but I was planning on fixing it in
> the next release.

Forwarding a message from Jos Hirth:

color-interpolation="sRGB"-ish:

- Inkscape
- Opera
- Safari 4/5 on Win32, Mobile Safari on iOS
- IE9


color-interpolation="linearRGB"-ish:

- Firefox
- Batik
- Chrome/Chromium
- Safari 5 on Mac (really odd)


My use case for sRGB:

http://kaioa.com/b/1102/svgjng/index.html (use Opera ;))

I basically emulate JNG's functionality with SVG here. As you can see the  
quality/size ratio is pretty impressive. The advantage becomes even bigger  
if the images are larger and photo-based (PNG8 becomes quickly unfeasible).

The SVG format is a lot more powerful than the JNG format. There are a few  
more things one could do to improve the size/quality ratio even further.  
There is no need to use a single image for color and a single image for  
the alpha channel. E.g. the upper 2/3 of the Jetpack mask could be more  
efficiently stored as PNG.


I still don't know why one might want linearRGB. It got that psycho-visual  
stuff going for it (doesn't really help if it's not supported by  
Inkscape), but that's about it. The main downside I can see is that it  
negatively affects antialiasing (e.g. if the mask is a fully opaque  
rectangle with some path drawn onto it).

I couldn't find out yet what Adobe Illustrator is doing.

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Friday, 4 February 2011 12:05:26 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:47 GMT