All Questions
21
questions
0
votes
0
answers
934
views
Convert a SVG to PNG react
I've an SVG image that includes two PNG images that makes them one SVG image, now I want to convert this image into PNG/JPG. I've the following code of SVG in react:
import P1 from "../../assets/...
0
votes
1
answer
1k
views
Load SVG into canvas to get base64 dataurl
I have this SVG in my html :
<svg xmlns="http://www.w3.org/2000/svg" class="bi flex-shrink-0 me-2 green-check" width="24" height="24" role="img" ...
0
votes
0
answers
185
views
Is there a way to use a transparent PNG as a path when drawing on a canvas in JavaScript / HTML5?
So what I'm trying to do is draw the outline of a body and fill it in with a user selected color. What I have right now is this initiation of shapes (the second one is iffy):
let shapes = [new Path2D('...
-1
votes
1
answer
175
views
Convert SVG groups into multiple "individual" PNG files
I have an SVG file containing multiple tags. When loading the file into an HTML canvas, the groups are recognised as separate objects. However, I would like to use javascript / Node to convert each ...
0
votes
0
answers
43
views
SVG/Canvas with background image to png conversion gives black background [duplicate]
I have a svg with background patterns defined using images. To convert this SVG into png and save in disk , I am using canvg to convert first into canvas and into png image as follows:
const canvas =...
0
votes
0
answers
105
views
Downloading an SVG as a PNG at a Specific Size via Javascript
I am trying to set up a generator to let people custom build wallpapers for their phones. At the moment I have them doing the customizing by editing an svg template by changing the colors and text ...
2
votes
0
answers
666
views
CSS styles not applied to SVG when SVG is rendered on Canvas
I am styling an SVG image using CSS in a separate file. Then I am rendering the SVG onto a canvas that can be saved as a PNG.
The SVG receives the CSS styles properly when it is just an SVG element on ...
0
votes
1
answer
456
views
SVG to PNG in javascript
I have a problem with converting svg to png(base64).
Svg to base64 works fine, because it displays just fine in the browser.
But when i try to load in the image, it won't load. Anybody might have an ...
0
votes
2
answers
888
views
Javascript canvas.toDataUrl() not encoding properly in Firefox [duplicate]
I'm trying to take an SVG and convert it to an image/png data url.
In Chrome 68 it works perfectly, but in Firefox 61 it renders an empty image with the URL of:
data:image/png;base64,...
0
votes
1
answer
291
views
How do I get the full canvas content (even the hidden ones) with Javascript?
I am currently working on a Javascript project and I am struggling with exporting the entire SVG image on the canvas. So far I've been only able to export the visible part of the canvas, with out the "...
0
votes
0
answers
237
views
JSON to PNG Empty picture
Need help with my function to download a PNG from a SVG.
I read many similar post about that but don't succeed to apply to my code.
The image that I download is empty ...
My code :
function ...
5
votes
1
answer
3k
views
How to Include CSS style when converting svg to png
i've created a simple SVG elment that get dowbloaded to png when clicking on a button, my solution is similiar to here
The basic idea is:
1.svg to canvas
2.canvas to dataUrl
3.trigger download from ...
1
vote
2
answers
3k
views
Convert d3 chart (svg) to an image and display it
Im trying to convert a d3 chart to a png image.
I've read many question on SO, which explains how to do it.
Capture HTML Canvas as gif/jpg/png/pdf?
Basically im trying this, what is mentioned in the ...
1
vote
1
answer
984
views
height,width and font not consistent when converting svg to png
I am trying to convert svg to png and I found that the converted image is not the same as svg. How can as assure consistency among both svg and png?
Code to covert svg to png
jQuery('#imgDiv')....
1
vote
1
answer
1k
views
SVG to PNG Conversion in javascript
I am working on d3.js charts. I have radar chart that I want to print in PNG format, but when I do conversion it shows nothing and when I save image it saved but totally black or some time gives error ...