javascript - Convert an ImageData object (not a canvas) to image dataURL -


i create dataurl imagedata object (i.e. width, height, data). realize canvas has this, want avoid distortions canvas use has (alpha premultiply mainly) .. i.e. want avoid obvious canvas.putimagedata step.

from this post can make arraybuffer/typedarray/dataview base64. dont know how canvas dataurl adds width/height uint8 data portion of base64 string. nor know how png conversion done. (i'd ok raw data image type don't think there 1 .. png , jpg)

possible approaches:

  • load imagedata canvas putimagedata. fails, distorts data.
  • create image img.src = base64 data. fails, has canvas dataurl.
  • other?

anyone know how construct image dataurl raw width, height, data imagedata?


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -