Jump to content


Photo

Retrieving Pixel Data From The Canvas


  • Please log in to reply
2 replies to this topic

#1 GretaGail

GretaGail

    New Member

  • Members
  • Pip
  • 1 posts

Posted 30 August 2011 - 04:59 PM

I've created a pretty simple javascript function to go over every pixel in a canvas and push it into an array. This is for eventually storing the data in mysql for later use. However, if the canvas is very big, say 600x400 (240,000 pixels), the script takes far too long and the browser kills it.

Is there another, faster way of doing this? Right now the only solution I can think of is to split the pixel data into chunks and run my little script on each chunk individually.

Any feedback would be super helpful, thanks!

#2 George Langley

George Langley

    New Member

  • Members
  • Pip
  • 2 posts

Posted 04 September 2011 - 03:56 PM

Wondering if it's possible to save the canvas as a png and upload it to your server. Then run something server-side to store it in your db.

#3 Eric Sorenson

Eric Sorenson

    New Member

  • Members
  • Pip
  • 9 posts
  • Gender:Male
  • Location:Madison, WI
  • Interests:HTML5, JavaScript

Posted 11 September 2011 - 10:03 AM

Wondering if it's possible to save the canvas as a png and upload it to your server. Then run something server-side to store it in your db.


Check out this post on the subject: http://29a.ch/2011/9...-imgur-data-uri




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users