W3C home > Mailing lists > Public > public-html@w3.org > April 2007

Re: non-rectangular images & <img> tag

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 25 Apr 2007 12:25:21 -0700
Message-Id: <5DFBBCC7-2007-4F6B-B70E-26ECCE8E9656@apple.com>
Cc: Matthew Raymond <mattraymond@earthlink.net>, Olivier GENDRIN <olivier.gendrin@gmail.com>, public-html@w3.org
To: Jeff Schiller <codedread@gmail.com>


On Apr 25, 2007, at 9:24 AM, Jeff Schiller wrote:

>
> On 4/24/07, Matthew Raymond <mattraymond@earthlink.net> wrote:
>>
>> Olivier GENDRIN wrote:
>> > But perhaps this should be done on the CSS side, as far it's a
>> > presentational issue...
>>
>>    I would say so. In fact, I'd like to see something like this:
>>
>> | <img src="Image.png" alt="" style="crop: url('circle.svg')" />
>>
>>    This would allow you to use the alpha values from images and  
>> and SVG
>> files to perform cropping of both images and other content.
>
> But if you're going to want to use SVG for this, then you'd be best to
> the whole thing today directly in SVG.  i.e. the SVG would contain the
> "image.png" raster in an SVG:image element, then it would be masked by
> a circle (or whatever) such that the image is cropped.  Then when you
> deploy this in your HTML it would be:
>
> <object type="image/svg+xml" data="cropped-image.svg" width="300"  
> height="200">
>  <img src="image.png" width="300" height="200"></img>
> </object>
>
> This would work today in browsers that support SVG and contain
> fallback for those that don't.  In my mind, no need to invent a new
> HTML facility for this because my assumption is that all browsers will
> eventually support SVG (we're kind of waiting on Internet Explorer).

It's really a CSS feature we are talking about, not HTML. I don't  
think CSS should leave out features just because SVG has them, since  
they have different use cases. CSS is a stylesheet language for  
controlling the presentation of various markup languages. SVG is a  
presentational markup language.  Using pure SVG may seem reasonable  
if your goal is to clip an image to a shape, but what if you want to  
clip a paragraph, section, or list?

The ability to mask to an image referenced in CSS and the ability to  
clip to a path expressed directly in CSS would both be useful. But as  
already stated, this would be a discussion for the CSS Working Group,  
not us.

Regards,
Maciej
Received on Wednesday, 25 April 2007 20:36:15 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:43 UTC