Hello all, Since I had a close look to filter effect, I noticed something : When zooming, the specular lighting filter is very ugly (here a screenshot http://lesgeorges.org/subdomains/pannini/media/specular_lighting.png But that's not an inkscape issue, there is the same problem is Batik.
Apparently (as far as I understood) this filter is raster-based and the FilterRes values are responsible for the quality. I just wanted to know what do you think of this.
(here is the svg example : http://www.w3.org/TR/SVG11/images/filters/filters01.svg)
Thanks for your response Steren http://lesgeorges.org/subdomains/pannini/media/specular_lighting.png
Sat, 3 Nov 2007 14:34:42 +0100 "Steren Giannini" <steren.giannini@...1819...> kirjoitti:
Since I had a close look to filter effect, I noticed something : When zooming, the specular lighting filter is very ugly (here a screenshot http://lesgeorges.org/subdomains/pannini/media/specular_lighting.png But that's not an inkscape issue, there is the same problem is Batik.
Apparently (as far as I understood) this filter is raster-based and the FilterRes values are responsible for the quality. I just wanted to know what do you think of this.
All filter effects are raster based. filterRes is responsible for the quality, to some extent. However, the pixel resolution of the image is not issue here. The colour resolution is.
Let me explain: lighting effects take as input a normal raster image buffer. In Inkscape, such buffer contains 4 channels - red, green, blue and alpha - each of which is 8 bits wide. Lighting effects discard the RGB channels and treat alpha channel as height map. This means, we have only 8 bits of height information, we can use for calculating lighting. This means 256 different height levels, not a single one more.
When you have 256 height levels and a slope longer than 256 pixels, by pigeonhole principle, there must be pixels that are at same height. When a lighting effect is applied to such a slope, instead of slope the effect sees several plateaus divided by small sharp cliffs.
There are possible cures for this, using higher bit depth being the most obvious. With a 16-bit height map, such problems would hardly appear, as you'd have to use 256 times larger zoom factor to see them. However, using 16-bits per channel would require major modifications to Inkscape. Simpler one would be to detect this special situation (output of gaussian blur used as height map) and make the gaussian blur output an 16-bit alpha only image. This in turn isn't a too nice a solution and would lead to confusion, as to why this usual case works just fine, but other means of creating height maps lead to odd rendering.
participants (2)
-
Niko Kiirala
-
Steren Giannini