I'm loading in a PNG to use as a texture in Unity. When I use ConvertToRawBits() it outputs to BGRA32. Is it possible to output to ARGB32 or RGBA32 instead?
https://gist.github.com/ciwolsey/24635ea523b4a6b758783688be53bf86
You have two options for this, you can:
Recompile Freeimage
with FREEIMAGE_COLORORDER
set to FREEIMAGE_COLORORDER_RGB
value (1). Then your loaded images will be always in RGBA32
format. If this FREEIMAGE_COLORORDER
is not specified at compile time, the actual color order setting is determined from the target system's endianess.
Use Freeimage
SwapRedBlue32
function to convert loaded image from BGRA32
to RGBA32
format.
Here is a nice discussion on this subject.