How to use this snippet of saving a png!

Hello! TArray of FColor is just raw data, while image formats have additionally meta. For example I check out this code

FBufferArchive Buffer;
FImageUtils::ExportRenderTarget2DAsPNG(textureRenderTarget2D, Buffer);
static auto projDir = FPaths::ProjectSavedDir();
FFileHelper::SaveArrayToFile(Buffer, *FPaths::Combine(projDir, "tmp.png"));

It is working only if Render Target has only one image format RGBA8. So, you can write different code for different formats of Render Target, that’s why you firstly should decide what format will by set to Render Target and after that details will be more obvious.