# Javascript canvas RGB read back

**URL:** <https://community.brave.app/t/javascript-canvas-rgb-read-back/385750>\
**Category:** Web Compatibility\
**Created:** [May 3, 2022, 6:46pm UTC](https://community.brave.app/t/javascript-canvas-rgb-read-back/385750 "2022-05-03T18:46:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JimB007](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@JimB007](https://community.brave.app/u/JimB007)\
**Post date:** [May 3, 2022, 6:46pm UTC](https://community.brave.app/t/javascript-canvas-rgb-read-back/385750/1 "2022-05-03T18:46:31Z")

</div>

ISSUE: When reading RGB data from a canvas image the returned R,G,B values are not a true representation of the values in the image. This has been observed during development testing of drawing/reading pixel data. Return R,G,B values vary slightly by +/- 1 suggesting a rounding error.

You can test this by right here. There is a link to a Javascript based program that draws a filed rectangle and reads back the RGB values. about half the time the test fails under Brave only.

([https://microstudio.dev/community/help/testers-wanted---to-check-if-rgb-values-are-returned-correctly/364/](https://microstudio.dev/community/help/testers-wanted---to-check-if-rgb-values-are-returned-correctly/364/))

The test passes on Firefox, Chrome, Chromium, Opera.  
The test fails on Brave (desktop and mobile)

Did the issue present with [default Shields settings] - Shields have no impact

Does the site function as expected when Shields are turned off? - No difference

Is there a specific Shields configuration that causes the site to break? If so, tell us that configuration. (yes/no): No

Does the site work as expected when using Chrome? Yes. according to other testers.

\*\*Brave version (check `About Brave`): 1.38.109

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/brave/original/3X/1/8/182067f3480d1a5e7aea5ae3131b116ca1ef7918.png) [@system](https://community.brave.app/u/system)\
**Post date:** [June 2, 2022, 6:47pm UTC](https://community.brave.app/t/javascript-canvas-rgb-read-back/385750/2 "2022-06-02T18:47:22Z")

</div>

Closed on June 2, 2022, 6:47pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
