Open hh0525 opened 10 months ago
Hi, I have the same problem. Did you solve it now?
I found that the problem came from the color sampling process of forward rendering. The parameter pt passed in this function is the coordinate of the point in the image space (canvas_width*canvas_height), but in fact it should be the relative position of the point in the path, similar to begin and end in linearGradient.
I found that the problem came from the color sampling process of forward rendering. The parameter pt passed in this function is the coordinate of the point in the image space (canvas_width*canvas_height), but in fact it should be the relative position of the point in the path, similar to begin and end in linearGradient.
Great! Can you tell me how to solve the color sampling problem? I am not familiar with this.
I initialized 2048 paths, with half of them filled with solid colors, and the other half filled with gradient colors (including linear and radial gradient). I optimized the SVG using L2 loss. When I open the final SVG with a browser like Edge, it appears to be full of color patches as below.
However, the final PNG rendering result is great.
I use render_svg.py in diffvg/apps folder to convert SVG to PNG and I get the same result: SVG is poor but PNG is great.
What is the problem? I hope someone can help me.