Re: non-rectangular images & <img> tag

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