# Different results with the same code on a computer and a smartphone (with used loadPixels())

**URL:** <https://discourse.processing.org/t/different-results-with-the-same-code-on-a-computer-and-a-smartphone-with-used-loadpixels/39346>\
**Category:** Beginners\
**Created:** [October 18, 2022, 7:16pm UTC](https://discourse.processing.org/t/different-results-with-the-same-code-on-a-computer-and-a-smartphone-with-used-loadpixels/39346 "2022-10-18T19:16:15Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 26, 2022, 6:15pm UTC](https://discourse.processing.org/t/different-results-with-the-same-code-on-a-computer-and-a-smartphone-with-used-loadpixels/39346/5 "2022-10-26T18:15:12Z")

</div>

I think you’d be interested in checking out a sketch that uses _pixels[]_ for both Java Mode & p5js flavors:

> [@Pixels array p5.js vs java improving speed](https://discourse.processing.org/t/pixels-array-p5-js-vs-java/38623/2):
>
> If your aim was just to make it run online just know your sketch is totally convertible to [Processing.js](https://gotoloop.github.io/processing-js.github.io/): index.html: \<script defer src=https://Unpkg.com/processing-js\>\</script\> \<canvas data-src=Trig\_Pixel\_Colors.pde\>\</canvas\> As you can see from the embedded [\<iframe\>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) above I’ve made many changes to your Java sketch. Most important 1 was moving the K[] array initialization to setup(). After all, nothing in the K[] array changes after it’s filled w/ colors the 1st time, just like A[]. Wh…

---

_[View the full topic](https://discourse.processing.org/t/different-results-with-the-same-code-on-a-computer-and-a-smartphone-with-used-loadpixels/39346)._
