- Home /
Wrong colors from ReadPixels()
When using Texture2D.ReadPixels() to read from a RenderTexture, I get the wrong colours when the texture I'm reading in to is ARGB32 and the right colours when the texture is RGB24. Also, when using ARGB32 I can get the right colors if I EncodeToJPG, but the wrong colours if I use EncodeToPNG.
When the colour is wrong, it looks far too light (on a white background) and the pixels have varying levels of transparency. Getting rid of the transparency doesn't seem to fix up the colours, they are still too light.
Has anyone come across this before? Is it possible to get an image that can handle transparency that also contains the right colors?
Can you attach a screenshot of your RenderTexture (RGB and A) channels, and picture that you get from ReadPixels+EncodeToPNG ?
Your answer
Follow this Question
Related Questions
Can a Texture2D be created at runtime from a snapshot of a RenderTexture? 3 Answers
ReadPixels generates corrupted textures on certain Android devices 0 Answers
Texture2D.EncodeToPNG not working on iOs on Unity 3.5.5f3 1 Answer
help packing 16 textures into a packedTexture using RenderTexture 0 Answers