# Latest chrome update breaks image() / loadpixels() combo

**URL:** <https://discourse.processing.org/t/latest-chrome-update-breaks-image-loadpixels-combo/43268>\
**Category:** p5.js\
**Created:** [November 20, 2023, 12:35pm UTC](https://discourse.processing.org/t/latest-chrome-update-breaks-image-loadpixels-combo/43268 "2023-11-20T12:35:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathansonic](https://avatars.discourse-cdn.com/v4/letter/n/ee7513/32.png) [@nathansonic](https://discourse.processing.org/u/nathansonic)\
**Post date:** [November 20, 2023, 12:35pm UTC](https://discourse.processing.org/t/latest-chrome-update-breaks-image-loadpixels-combo/43268/1 "2023-11-20T12:35:39Z")

</div>

After the last chrome update a p5 program I’ve been working on has broken.

I’m using image() to draw an image on the canvas and on mouseup the canvas is stored using loadpixels(). This is so I have some undo data to go back to. Since the chrome update, every time it runs loadpixels() it clears the canvas and I lose the drawing.

Is this a bug that needs to be addressed?  
Is there a better way I could be doing this?

Worth noting, it still works as intended on Firefox.

Here is a basic example of what I’m working with: [p5.js Web Editor](https://editor.p5js.org/nathansonic/sketches/5bFi6iBpg)  
And to compare, if you draw a rect instead of an image the canvas does not clear

```auto
let canvas

preload = function () {
    img = loadImage('https://static.vecteezy.com/system/resources/thumbnails/008/505/460/small/watercolor-moon-and-star-clipart-png.png');
}

function setup() {
  canvas = createCanvas(400, 400);
  canvas.mousePressed(mouseDown);
  canvas.mouseReleased(mouseUp);
  noLoop();
}

function draw() {
  image(img, mouseX, mouseY, 50, 50);
  // rect(mouseX, mouseY, 50, 50);
}

function mouseUp() {
  noLoop();
  canvas.loadPixels(); // load the pixel array
}

function mouseDown() {
  loop();
}

```
