Questions tagged [getimagedata]

a function to access the raw pixel data of HTML5 canvas element.

a function to access the raw pixel data of HTML5 canvas element.

For more information see the MDN documentation of CanvasRenderingContext2D.

211 questions
0
votes
2 answers

Is there an onload function for html canvas?

My goal is to create an array of imageData from a series of png images. In order to do this I use a for loop to go through the images, put them in the canvas and then retrieve and store the created imageData in an array. The problem is that the…
0
votes
1 answer

Canvas putImageData XOR issue only on iPad

Does anyone know what is wrong with the following code. Demo: http://jsbin.com/xecicovi/1/ It runs fine on windows and android but the cursor inconsistently leaves some trail lines on iPad. I am using getImageData and XOR'ing the bits and…
Rex Hui
  • 71
  • 1
  • 7
0
votes
1 answer

canvas getImageData two images

everybody, I need to get the color of my image that is in my canvas object. That's what I am doing right now: _canvas.getContext('2d').getImageData(event.offsetX, event.offsetY, 1, 1).data; This is what I want, but I have two images... one does'nt…
Hugo S. Mendes
  • 1,076
  • 11
  • 23
0
votes
1 answer

There is a way in Tumblr to get media images URL in the same domain of the blog name?

Lets say my blog is http://foo.tumblr.com. All the post's images are stored in xx.media.tumblr... (for example: https://24.media.tumblr.com/tumblr_kzjlfiTnfe1qz4rgho1_250.jpg) (first 2 numbers can be skipped) But i want the URL of the image be in…
yukatta
  • 505
  • 2
  • 7
  • 16
0
votes
1 answer

Javascript: Correct way to load image to canvas for getImageData?

I wrote a simple libraryless rotozoomer for html5-canvas, and I'm wondering what is the correct way to let image load to canvas before using getImageData? var hc = document.getElementById("hiddenCanvas"); var hctx = hc.getContext("2d"); // Hidden…
0
votes
1 answer

HTML5 Canvas getImageData value pixel color flickering white and black

I'm creating a color picker and I have it pulling the color from the HTML5 canvas with the gradient. Most of the time it's displaying the proper color, but sometimes it will randomly display white or black. I have a demo below where it logs all…
Keavon
  • 6,837
  • 9
  • 51
  • 79
0
votes
1 answer

Chroma keying with javascript & jQuery

Okay, we need your help! We (with our informatics class) are building a digital scratchmap! Like this: (source: megagadgets.nl) With your mouse you should be able to scratch out the places you've been to. Now we're stuck. We have a canvas and we…
Luud Janssen
  • 362
  • 1
  • 3
  • 12
0
votes
1 answer

.getImageData() with background-image property?

How can one use .getImageData() to get the data from the background-image of a given element? Project is already using jQuery, so jQuery solutions welcome.
z t
  • 133
  • 1
  • 1
  • 9
0
votes
1 answer

canvas getImageData returns too many pixels

I'm creating a mobile webapp game that lets the user swipe over the screen to clear it. I am trying to write a smart function that detects when nearly the whole canvas is transparent. I have an interval that calls the function below each second, to…
funkyfly
  • 1,144
  • 1
  • 11
  • 18
0
votes
1 answer

fetch complete data of any image wordpress

I want to fetch complete data of an image. Which and how should I use any function? Title shows title of post but I want Title of image to be displayed. What should I do?
shweta
  • 19
  • 1
  • 5
0
votes
1 answer

Method DrawImage in Firefox does not work correctly with green pixels?

For example, when I paint on canvas image of one pixel, and then attempt to see what is painted on the canvas, I get a different color? In the code below, the first image pixel has a color rgba (0,255,0,255), but when I try to bring him a red…
0
votes
2 answers

DOM Exception 18 getImageData

I've run into an error that a lot of people seem to have gotten in the past but the explanations are not clear to me. After using the .getImageData() method in my javascript to get the pixel data of a picture that I have stored on my computer and…
user2517142
  • 321
  • 1
  • 2
  • 5
0
votes
1 answer

Javascript Canvas Get images pixel data

I have a two part question about javascript canvas: Part 1: I have a .jpg in the same file as my html document. I was wondering if there was a simple way of getting a pixel's color in that file without having to use context.getImageData(). Part 2:…
user1642826
  • 219
  • 1
  • 2
  • 15
0
votes
2 answers

Collision detection on a canvas in JavaScript

I'm working on a game for a university assignment. The idea is that you defend the centre circle from the incoming asteroids (lines) by drawing a line (click, drag & release to draw a line) which blocks them. An asteroid hitting a line should…
gideonparanoid
  • 156
  • 1
  • 3
  • 12
0
votes
1 answer

Mozilla getImageDataProblem

I have problem with getImageData in Mozilla. I did a function that after click on canvas get coordinates of mouse. Coordinates are good, but there is problem, that in Mozilla it gives mi bad numbers of getImageDatas - for example in chrome it gives…
Jan Kožušník
  • 683
  • 3
  • 16
  • 30