Closed LaurenzV closed 1 week ago
Not sure if we should update docs/svg2-changelog.md
, Painting section, as well. Does it classify as SVG 2 feature? No one knows... But I guess so.
We should also update CLI help for resvg/usvg. The --image-rendering
flag.
Also, aren't pixelated
requires integer scaling?
https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering#pixelated
Also, aren't pixelated requires integer scaling?
Looks like it, but tiny-skia
doesn't support that, right? I basically just used the closest match we have for each attribute, it's possible that some are not 100% as required by the spec. Should I document that somewhere or?
I don't think tiny-skia
should support this. This is purely a resvg/usvg task. We have to readjust/reset image
size. At least this is my understanding. I haven't looked deep into it.
The only way to "document" it is to create a test that would be failing.
I personally thought the whole point of this feature is pixelated
, otherwise you could achieve the same with imageRendering
. Or is it purely to support CSS variants?
Yes, the main intention was to support the CSS attributes in the first place, so that you don’t end up with bicubic rendering if “pixelated” was requested.
But I will see whether I can figure it out.
@LaurenzV can you ping on email? I haven't been able to find your email.
Sent you an e-mail with the content "animation-charred-annoying-otter".
I think getting pixelated 100% correct is going to be very difficult. I think what we would have to do is
But this is pretty hard because it requires us to change the transform in the parent group of the image that scales the raster image to the intended size.
Would it be okay for you if I simply remark in the source code that pixelated doesn't work completely correctly yet?
Yes, we can "skip" pixelated
as part of this commit.
As for parent transforms, yes, I'm not sure what is the expected output here. We need a bunch of tests to figure it out. If the spec expects the image to be pixelated in canvas coordinates and not object coordinates (not transforms) then we're screwed. That would be a serious change.
And I'm not even sure what we're expected to do when rotation and/or skew transforms are present. Preserving integer scaling in all situation would be hard.
Let's add image-rendering
to docs/svg2-changelog.md
and note that pixelated
is partially supported there.
Thanks!
Fixes #828