You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The input svg file is a circle with gradients. The issue is that on the output png file, on the very right of the circle the gradient is cut off showing a sharp line.
constsvg=``// svg string version from svg code exampleconstresvg=newResvg(svg);constpngData=resvg.render();constpngBuffer=pngData.asPng();awaitpromises.writeFile(join(__dirname,"./text-out.png"),pngBuffer);
The text was updated successfully, but these errors were encountered:
@aquaductape I found this issue because I'm doing exactly what you're doing - porting boring avatar marble to Node.
I removed feGaussianBlur from the SVG and am now using Sharp to apply the blur:
sharp(svgBuffer).blur(amount).jpeg().toBuffer();
Turns out this is ~5x faster and the result is ~20x smaller.
name hz min max mean p75 p99 p995 p999 rme samples
· marble Resvg PNG 20.5649 25.8698 70.7037 48.6264 60.7421 70.7037 70.7037 70.7037 ±19.48% 11
· marble Sharp JPEG 98.8347 8.8393 13.0902 10.1179 10.6770 13.0902 13.0902 13.0902 ±2.45% 50 fastest
The input svg file is a circle with gradients. The issue is that on the output png file, on the very right of the circle the gradient is cut off showing a sharp line.
Input svg file.
Output png file.
Input svg code.
The text was updated successfully, but these errors were encountered: