# DynamicTexture: getContext() Chrome warning

**URL:** <https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620>\
**Category:** Questions\
**Tags:** material\
**Created:** [April 4, 2023, 3:32pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620 "2023-04-04T15:32:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![olli2home](https://avatars.discourse-cdn.com/v4/letter/o/7ab992/32.png) [@olli2home](https://forum.babylonjs.com/u/olli2home)\
**Post date:** [April 4, 2023, 3:32pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620/1 "2023-04-04T15:32:07Z")

</div>

Hello,  
when using DynamicTexture I always get these messages in Chrome:

Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. …

How can I set this attribute in babylonjs?

Thanks

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 4, 2023, 6:33pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620/2 "2023-04-04T18:33:42Z")

</div>

Hello! Can you share a Playground where this is happening?

---

<div class="post-metadata">

**Author:** ![olli2home](https://avatars.discourse-cdn.com/v4/letter/o/7ab992/32.png) [@olli2home](https://forum.babylonjs.com/u/olli2home)\
**Post date:** [April 5, 2023, 2:30pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620/3 "2023-04-05T14:30:55Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#5ZCGRM%234052)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

The second time getImageData() is called, a message is displayed in the console.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 5, 2023, 4:22pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620/4 "2023-04-05T16:22:50Z")

</div>

It is kind of normal and expected as you are using lots (2… which is not that many) readback then write on the context so Chrome wants to let you know to use the CPU version instead as CPU/GPU go and back are slow.

You should disregard the message in this particular case if you really need to read/write/read/write that frequently.

Usually there is smthg strange about read/write as frequently as the first read could contain most of the info you need.

---

<div class="post-metadata">

**Author:** ![olli2home](https://avatars.discourse-cdn.com/v4/letter/o/7ab992/32.png) [@olli2home](https://forum.babylonjs.com/u/olli2home)\
**Post date:** [April 5, 2023, 5:11pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620/5 "2023-04-05T17:11:16Z")

</div>

Thanks for the feedback. I need multiple read/write calls because I’m creating procedural textures that are copied into themselves.  
Still, is there a way to set this “willReadFrequently” attribute in BabylonJS?  
Thanks

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 5, 2023, 5:31pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620/6 "2023-04-05T17:31:27Z")

</div>

You could use some code like this to control fully the canvas: [https://playground.babylonjs.com/#5ZCGRM#4053](https://playground.babylonjs.com/#5ZCGRM#4053)

---

<div class="post-metadata">

**Author:** ![olli2home](https://avatars.discourse-cdn.com/v4/letter/o/7ab992/32.png) [@olli2home](https://forum.babylonjs.com/u/olli2home)\
**Post date:** [April 5, 2023, 5:43pm UTC](https://forum.babylonjs.com/t/dynamictexture-getcontext-chrome-warning/39620/7 "2023-04-05T17:43:41Z")

</div>

Well, there it is, the solution.

Thanks
