Skip to content

Pythoner321123/UnrealTextureToolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Unreal Image Conversion Library

A lightweight Unreal Engine C++ + Blueprint library for converting Render Targets, Textures, and raw Color Arrays.

πŸ“˜ Overview

Unreal Image Conversion Library provides three essential low-level functions for handling GPU ↔ CPU image data inside Unreal Engine.

It exposes safe and Blueprint-friendly versions of common operations that developers normally struggle to implement on their own:

Read pixels from a Render Target into a CPU array

Write a CPU color array into a Render Target

Generate a Texture2D dynamically from a CPU color array

This is ideal for systems such as:

In-game painting

Screenshot capture & processing

Texture streaming

Data-driven UI

Procedural texture generation

Save/load image data

Pixel-based simulation systems

πŸš€ Features

βœ” Render Target β†’ Color Array (GPU β†’ CPU)

βœ” Color Array β†’ Render Target (CPU β†’ GPU)

βœ” Color Array β†’ Texture2D (CPU β†’ GPU + asset creation)

βœ” Fully Blueprint-exposed

βœ” Designed for save/load systems

βœ” Works with any pixel format supported by Unreal

βœ” Lightweight, dependency-free C++

πŸ”§ Functions

  1. RenderTargetToColorArray

Direction: GPU β†’ CPU Reads pixel data from a UTextureRenderTarget2D and returns an array of FColor.

Use cases:

Saving a drawn canvas

Extracting visual data for gameplay logic

Serializing image states

  1. ColorArrayToRenderTarget

Direction: CPU β†’ GPU Writes a given array of colors into an existing Render Target.

Use cases:

Loading saved drawings

Overwriting a render target with processed data

Displaying procedurally computed images

  1. ColorArrayToTexture2D

Direction: CPU β†’ GPU Creates a new UTexture2D from a color array.

Use cases:

Creating UI icons dynamically

Converting raw image data into textures

Generating crafting/item icons at runtime

πŸ“¦ Installation

  1. Clone the Repository git clone https://github.com/YourName/UnrealImageConversionLibrary.git

  2. Add to Your Unreal Project

Place the plugin or source folder into your project's /Plugins or /Source directory.

Regenerate project files.

Recompile.

  1. Enable From Editor

Edit β†’ Plugins β†’ Project β†’ Image Conversion Library

🧩 Blueprint Usage Order

When doing Save & Load, use the functions in this order:

Saving Images

1️⃣ Render Target β†’ Color Array 2️⃣ Store the Color Array (GI / SaveGame / Disk)

Loading Images

1️⃣ Retrieve stored Color Array 2️⃣ Color Array β†’ Render Target or Color Array β†’ Texture2D

πŸ“ Folder Structure /Source /ImageConversionLibrary ImageConversionLibrary.Build.cs Public/ ColorArrayConversionBPLibrary.h Private/ ColorArrayConversionBPLibrary.cpp

πŸ§ͺ Example Blueprint Graph

βœ” Read player’s drawing β†’ Save color data βœ” Load color data β†’ Restore drawing βœ” Display restored drawing on any mesh or widget

πŸ“š Documentation Goals

This library is meant to solve common problems such as:

Why can’t I save a Render Target?

Why can’t I serialize a Material Instance Dynamic?

How do I convert GPU textures into UObject assets?

How do I get pixel-accurate data into Blueprints?

With these functions, you finally can.

πŸ›  Future Improvements

Texture compression helpers

PNG/JPEG loading (optional)

Async CPU/GPU copy operations

Mip-generation helpers

Material Instance β†’ Serialized Metadata support

πŸ§‘β€πŸ’» Contribution

Pull requests are welcome! Please open an issue for feature requests or bug reports.

πŸ“„ License

MIT License β€” free for commercial and non-commercial use.

If you want, I can also generate: βœ… GitHub repo description βœ… Repository tags βœ… A professional project logo (via image generation) βœ… Sample C++ usage βœ… A wiki page structure

Just say the word.

About

A lightweight C++ library for serializing Render Targets and generating textures from raw color arrays

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages