Answer the question
In order to leave comments, you need to log in
Is it possible to know the size in bytes of an image created with convas?
Hello! Is there any way to find out the size of an image in bytes created with canvas?
For example: I created a smiley, you need to determine the size of this smiley in bytes.
Answer the question
In order to leave comments, you need to log in
The image is drawn in the canvas as is, in bitmap, without compression (Png / jpg and others). Therefore, feel free to use the formula
width*height*4
where 4 is RGBA
Well, or you can get from toDataURL("image/png") and find out the size there
The size of this emoji in bytes will depend on what format you save it in.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question