How can I save an image out through code?

I’ve got a sphere with UV coordinates and and a 3d noise. I’m trying to write out the sampled noise for the sphere into a 2d texture. I have gone through Rama’s save to binary file and have other containers working using that, but I’m having trouble finding information on how to save out an image file.

For this I created a location to UVs coordinates, and UVs to coordinates conversion. Then for each pixel width, then height I move the UV coords over by the pixel increment and get the sampled noise at the sphere location, and convert to a pixel height value. Then I used the FImageUtils::CompressImageArray(width, height, TArray values, TArray 8bitarrayToDumpDataTo) to format my data for export. Then it was just a normal binary export using FFileHelper::SaveArrayToFile(8bitarrayToDumpDataTo, destinationDirectory)