bulia byak wrote:
I got an idea today which I went on to quickly implement, so you can test it in CVS already.
Now when you import a bitmap into your drawing, it appears not as an <image> element but as a <rect> with pattern fill, the pattern being the image you imported. It looks the same, but the important difference is that you can easily "mask" the image by changing the shape of the rect (round corners, or convert to path and node-edit, or apply some booleans etc. just as you would with any rectangle). I think this makes it a lot more useful and I would even suggest making this a default (as it is now in CVS), although an option to create <image> as before still remains.
Personally, I don't think that it is a good idea for this to be the default. My understanding was that inkscape is to be an SVG editor rather than just another vector drawing app which happens to use the SVG namespace as part of its XML file format. That is certainly the reason that I have enthusiastically adopted it.
To me, using a pattern filled rectangle as the *default* way of placing a simple bitmap onto the image cannot be described as clean SVG (even though it is certainly legal). In fact, as far as I can see, the best way to model the use cases you've mentioned would be an <image> with a clip-path rather than a pattern-fill, though I can see that it cannot be implemented this way in inkscape until clipping is supported.
In all of my use of images, I have either wanted them rectangular or they have come with a suitable alpha mask [0]. I can see the utility of more complex cropping I just wanted to point out that it isn't universal. As I frequently take inkscape SVG output, as input to further processing I'm quite keen for it to be easy to use inkscape to produce and edit clean SVG.
That isn't to say that the new functionality isn't good - implementing any new svg feature is a good thing. Just that doing simple things should produce clean and simple SVG. I think an option on the import selector (with its default globally configurable) would be the best way to expose this feature.
Thanks for listening,
John (a very happy inkscape user)
[0] As an aside: has any thought been given to supporting JNG? It is a variant of PNG supporting jpeg compressed image data with a PNG alpha channel, and is specified as part of MNG: http://www.libmng.com/pub/mng/