- Home /
Unity ruins image horribly
Ok, so I decided to finally make the gui elements of my game. I imported my images for the buttons into unity. And they have been distorted horribly by Unity.
Original image:
Image after importing to Unity:
I read on some other threads and stuff that you have to play with the shader or something, but nowhere in the import settings is there an option for that. I can either keep it as a texture, gui, etc but no option lets me do anything any solution google has provided. I've tried all/most fixes for this, but none work even slightly.
Thanks for your time
Not showing. Image URL points to temp folder, which is probably YOUR temp folder on Unity answers.
Answer by Pickleninja · Sep 16, 2013 at 08:14 PM
I use to have problems with GUI images in unity appearing blurred, this is what I did to correct the problem.
click on the image in Unity, and view it in the inspector tab
a.) change texture type to 'Advanced'
b.) set non power of 2 to 'None'
c.) check read/write enabled.
d.) set wrap mode to 'clamp'
e.) set filter mode to 'point'
f.) At the bottom, make sure that the Max Size is greater than the size of your image.
g.) Set Filter to either Automatic True Color, or RGBA 32bit
Check the quality settings by going to edit -> project settings -> quality Make sure that 'Texture Quality' is set to 'full res'.
Also keep in $$anonymous$$d rhe GUI will blur if you stretch the image too large or small. It will depend on the pixel count you set it at in your design software.
I did exactly what you said. It's definitely better than before! But it still isn't like the original image. The original image has crisp borders, and well defined curves/ edges, where as the unity one is aliasing badly even though in my settings I've set anti aliasing to 8x
This is how it originally looked in Unity
This is how it looks after applying your fix:
I noticed your image is 1096 x 496
Click on the image again in Unity, and go into the inspector tab.
At the bottom there is a couple of menu items. Change them to this.
$$anonymous$$ax Size: 2048 Format: RGBA 32bit
Answer by YoungDeveloper · Sep 16, 2013 at 05:59 PM
Try this, select your gui texture in project folder, in inspector set texture type to gui, filter mode Trilinear, size (depending on your texture size), and format to truecolor.
I'm only getting two options. Texture type and filter mode. No other options.
Ok, just noticed when I click on 'gui' it gives this error in the log
ArgumentException: $$anonymous$$ay only be called in OnPostProcessTexture
UnityEditor.TextureImporterInspector.SizeAndFormatGUI () (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/$$anonymous$$ono/ImportSettings/TextureImporterInspector.cs:1643)
UnityEditor.TextureImporterInspector.OnInspectorGUI () (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/$$anonymous$$ono/ImportSettings/TextureImporterInspector.cs:1158)
UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/$$anonymous$$ono/Inspector/InspectorWindow.cs:888)
Answer by Jeff-Rosenberg · Sep 16, 2013 at 07:27 PM
I can't see the images (it sounds like some were linked), but we're also doing our GUI for a game right now. If you're using Unity's GUI and a custom GUISkin, one of the settings for your styles is Border. This slices your texture's sprite into parts, which Unity will stretch individually (like how they have their default button) instead of stretching the texture as a whole to fill an area.
You can also set your texture in Unity to use Advanced options:
Non Power of 2 > None
Wrap Mode > Clamp
Filter Mode > Point (for pixely GUI) or Bilinear or Trilinear (for smoother GUI)
Format > Anything uncompressed or Automatic Truecolor
Somehow I'm unable to get the advanced options. Wheres the menu for that? And I'm getting an error when I try to do anything in the texture import settings. Any help?
Your answer
Follow this Question
Related Questions
Cannot set UnityUI.Image opacity when place on a UnityUI.Button 2 Answers
GUI Button using .png image? 1 Answer
Best Button for UnityGame 2D 1 Answer
Image resize and save 0 Answers
Imported image quality; changed color? 2 Answers