W3C home > Mailing lists > Public > www-style@w3.org > April 2007

Re: [Fwd: Re: non-rectangular images & <img> tag]

From: Daniel Beardsmore <public@telcontar.net>
Date: Wed, 25 Apr 2007 17:11:42 +0100
Message-ID: <462F7DBE.9030905@telcontar.net>
To: www-style@w3.org

Bert Bos wrote:
> On Wednesday 25 April 2007 15:09, Paul Nelson (ATC) wrote:
>> Could an image map possibly be used to define the outline of the area
>> to flow around?
> The last serious discussion about it was in 1996... Using a language of 
> circles and polygons was considered, as well as using a separate image 
> as a mask, but the simplest solution seemed to be to just use one image 
> and make it transparent in the right places. But even that seemed too 
> much for browsers at the time and it has been postponed ever since.
> I still think that that simple solution is the best. Separating the 
> contour from the image seems overkill. Just load the image into a 
> paint/graphics program, cut out the contour and make sure the 
> transparency is no more than 99% everywhere else. It means the method 
> is image-format specific, it won't work with JPEG, e.g., but if it 
> works with PNG and SVG, that should be enough.

I've always considered it a great shame that JPEG as a format has no 
transparency, mask or alpha. It means that if I want to put a mask or alpha 
channel on a photograph, my only options are GIF compression (large, dithered 
file) or PNG (larger dithered image (due to the full alpha channel), or ultra 
large, 32-bit image).

The photo is then constrained to the background colour of the pixels that would 
otherwise be transparent.

If we're going for the approach of using a second file for the mask, we could 
allow putting an alpha channel on a JPEG using a second, greyscale JPEG (nice, 
small file) but it's a bit of an unwieldly approach! But pushing out a 
half-decent implementation of JPEG would be even harder to get adopted :)
Received on Wednesday, 25 April 2007 16:13:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:28 UTC