PNG images rendered darker than they should be
For some reason PNG images are rendered darker than they should be, both in <image>
and in <feImage>
. Apart from other things, this skews some filter test results (composite and displacement map filter tests). Applying extra sRGB unlinearization (or rather not applying the due input linearization, while still doing unlinearization in the end, in the compositing filter which I was testing at that time) seemed to fix the PNG image colors. Interestingly enough, JPEG images seem to be loaded fine.
I checked the code for loading images, specifically rsvg_cairo_surface_from_pixbuf()
, since it does some interesting transformations based on whether the image is 3-channel or 4-channel (which is probably related because JPEGs don't have an alpha channel AFAIK), but they seemed to be correct (I replaced the integer premultiplication code with more obvious floating point version to check and it didn't result in any difference).