# Creating texture assets from python

**URL:** <https://forums.unrealengine.com/t/creating-texture-assets-from-python/246337>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [August 19, 2021, 12:29pm UTC](https://forums.unrealengine.com/t/creating-texture-assets-from-python/246337 "2021-08-19T12:29:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CKing2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cking2/32/88714_2.png) [@CKing2](https://forums.unrealengine.com/u/CKing2)\
**Post date:** [August 19, 2021, 12:29pm UTC](https://forums.unrealengine.com/t/creating-texture-assets-from-python/246337/1 "2021-08-19T12:29:40Z")

</div>

I would like to create texture assets from a python script. I can’t find any examples of how to do this. I see examples of how to use AssetTools.create\_asset for other types of assets but that doesn’t seem to work for textures.

Suggestions?

Thanks,  
Chris King  
Spire Animation Studios

---

<div class="post-metadata">

**Author:** ![SethFrolich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SethFrolich](https://forums.unrealengine.com/u/SethFrolich)\
**Post date:** [May 18, 2023, 10:55am UTC](https://forums.unrealengine.com/t/creating-texture-assets-from-python/246337/2 "2023-05-18T10:55:19Z")

</div>

I realize this is kinda old now, but it’s the top result on Google right now.

You _can_ use AssetTools to create a Texture2D asset. The issue is getting your hands on a Texture2DFactoryNew instance to feed to the AssetTools.

 ![AssetToolsTrick](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/c/92c516e46d9e8c14049dcd99a421d5ad0b7385f6.jpeg)

You can use Python to create a default Texture2DFactoryNew instance, feed that into the AssetTools to create the asset, then use a render target to write to the new asset while overriding all the asset’s properties, such as format, compression, etc… Sadly, there’s very little you can do to/with the factory instance, so you can’t really initialize your Texture2D asset to the expected values, but the render to texture call can do that for you.
