O'Reilly Forums: Retrieving Pixel Data From The Canvas - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Retrieving Pixel Data From The Canvas

#1 User is offline   GretaGail 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 30-August 11

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!
0

#2 User is offline   George Langley 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 31-August 11

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.
0

#3 User is offline   Eric Sorenson 

  • New Member
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 30-May 11
  • Gender:Male
  • Location:Madison, WI
  • Interests:HTML5, JavaScript

Posted 11 September 2011 - 10:03 AM

View PostGeorge Langley, on 04 September 2011 - 03:56 PM, said:

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users