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
- Inspector elements are rendered twice when the script component is added via drag-and-drop while the HideFlags.HideInInspector property is set
- Error "Light baking failed with error code 5 (Convergence data not available while rendering lightmaps)" thrown in Console when generating lighting for specific GameObjects
- Copy and Paste options for an Animation Property value are disabled in the Right click contextual menu
- Asset is not found when searching the Label "NewLabel" in Search Window
- "Compute dispatch: missing texture ID..." and "Compute dispatch: missing UAV ID..." warnings are thrown after changing the platform in High Definition 3D template
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.