# Create Image/Texture From ImageData/Colour Data

**URL:** <https://phaser.discourse.group/t/create-image-texture-from-imagedata-colour-data/8547>\
**Category:** Phaser 3\
**Created:** [January 4, 2021, 9:16am UTC](https://phaser.discourse.group/t/create-image-texture-from-imagedata-colour-data/8547 "2021-01-04T09:16:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjhardisty](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mjhardisty/32/4815_2.png) [@mjhardisty](https://phaser.discourse.group/u/mjhardisty)\
**Post date:** [January 4, 2021, 9:16am UTC](https://phaser.discourse.group/t/create-image-texture-from-imagedata-colour-data/8547/1 "2021-01-04T09:16:44Z")

</div>

I’ve a basic png image that is preloaded. I want to generate different textures from that base texture based upon an algorithm to replace certain pixel colours. I can used getPixel to query the RGBA content and generate new colours, but I can’t find an easy way to generate a new texture from the modified data. textures.generate only accepts a limited palette, is there a way to generate a texture from pixels that have RBGA information?

---

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [January 4, 2021, 10:03am UTC](https://phaser.discourse.group/t/create-image-texture-from-imagedata-colour-data/8547/2 "2021-01-04T10:03:06Z")

</div>

Draw it on a RenderTexture or CanvasTexture.
