Title: Bug with using getImageData
Last modified: July 20, 2023

---

# Bug with using getImageData

 *  Resolved [ace0930](https://wordpress.org/support/users/ace0930/)
 * (@ace0930)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/bug-with-using-getimagedata/)
 * I’m creating a color picker and use the `getImageData` to get the color of the
   pixel where I click on it. It is not working when I run this code on WordPress
   environment. But it works when I use the exact same codes on other environment.
   
   Try this out: [https://jsfiddle.net/xob407fc/](https://jsfiddle.net/xob407fc/)
   P.S.: I’m sure the script is properly enqueue. There is no conflict of plugins.
   No error in the console, when you click the canvas, you always get rgb(0,0,0).

Viewing 1 replies (of 1 total)

 *  Thread Starter [ace0930](https://wordpress.org/support/users/ace0930/)
 * (@ace0930)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/bug-with-using-getimagedata/#post-16910408)
 * Update: Use offsetX and offsetY instead.

Viewing 1 replies (of 1 total)

The topic ‘Bug with using getImageData’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 1 participant
 * Last reply from: [ace0930](https://wordpress.org/support/users/ace0930/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/bug-with-using-getimagedata/#post-16910408)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
