Search Issue Tracker
By Design
Votes
0
Found in
2018.3.0a1
2019.1.0a1
2019.1.9f1
2019.2.0a1
2019.3.0a1
Issue ID
1168207
Regression
Yes
Texture2D has distorted colors when JPG files are attached to Texture2D via script
Steps to reproduce:
1. Open users attached project "Test.zip"
2. Open "Main.scene"
3. Enter Play Mode
4. Use "Scale" of the Game View to zoom in to see more clearly the black & white rectangles
5. Note that the black is perfectly black
6. Select "Main Camera" and under "C main" component change Texture source to PatternJpg from Project -> Assets-> Textures
7. Note that some grey/white pixels appeared in Black coloured areas
Expected results: JPG images show the same colour as they were created
Actual results: JPG images show colour distortion when imported in Unity
Reproducible with: 2018.3.0a1, 2018.4.3f1, 2019.1.9f1, 2019.2.0b7, 2019.3.0a8
Not Reproducible with: 2017.4.29f1
Note: It appears that this issue reproduces only when attaching the jpg file to a Texture2D via script
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
By design as the JPEG coding artifacts getting amplified by texture magnification and rendering. The user should definitely not use JPEG source files for these type of textures. Freeimage seems to be decoding this JPEG with more artifacts than some other decoders, probably caused by FreeImage preferring faster processing over quality. So a user inspecting the original JPEG could see fewer artifacts than what he gets after Unity loads it through FreeImage.