- Home /
PNG Transparency
Hi, I'm attempting to make a main menu, and here is the button I have in photoshop CS6:
![alt text][1]
I know its not the best looking in the world, but its temporary. Now, if you see in the red circled area, that I have sort of a cut-off corner look going, and it is indeed transparent. Now, when I import this into Unity, I am putting it on a plane, because I cannot just drag and drop the PNG into the scene. (If anyone knows better ways to import a PNG, please share) However, when I import it, the corner is not transparent like it is in photoshop.
![alt text][2]
As you can see, there is still black in that little cut-off area. Help please? [1]: /storage/temp/8329-unity2.png [2]: /storage/temp/8330-unity1.png
Answer by robertbu · Feb 27, 2013 at 03:25 AM
There are two things you must do in order to get transparency. First you must have an import setting that saves the alpha channel. Select your texture and in the inspector set Texture Type to "Advanced," turn off "Generate Mip Maps" and Set Format to RGBA 32 bit. These may not be the setting you want to ship with, but they are a starting point that gives you transparency and high quality.
If this does not fix your problem, you will need to change your shader on the material you use for your images. Only some of the shaders support transparency. You can start with the Unlit/Transparent shader.
Answer by thekingofclubs · Aug 03, 2014 at 05:57 PM
I tried this and it worked: Select texture, in the inspector set Texture Type to "Texture", check Aplha from Grayscale, you will see Alpha is Transperancy under it check that too. Done.
Answer by Ikarooz · Sep 16, 2018 at 06:17 PM
For everybody who might tumble over this thread: In photoshop it helped for me to put an additional, empty, transparent layer as a background. Somehow with that empty extra layer, unity will recognize the transparency
So save your image with transparency as explained above, then simply drag it into your assets folder, change Texture Type to "Sprite (2D and UI)" and hit the Apply-Button at the very bottom of the Inspector, it should convert the image just fine then
Answer by Artist3d · Jan 20, 2018 at 12:40 AM
I find this whole PNG transparency unnecessarily awkward with Unity3d (5.6). You really must experiment with more than a few export settings in whatever graphics program you are using. Since I use Paint Shop Pro here is all I found that worked consistently: Create image with transparency.. . Save As PNG/select Options button/check non-interlaced, non-optimized radio buttons/Run Optimizer/Run Wizard/Next/Next/Use Existing Transparency area/Next/Use the eye dropper to pick the transparent color in your image/Next/Verify in preview it looks the way you want ---> Click Finish
Looks more complicated than it is but it works.
In Unity Import Asset/Your.png/select 'index texture alpha' and alpha is transparency/uncheck generate mip maps/click apply.
Create a material and drag the png into the albedo field and select Shader/unlit/transparent cutout
HINTS: For each unsuccessful attempt you make, be sure to delete the previous file and input the asset with a new name so Unity3d sees it as a completely unique file. I wasted time, over-writing my initial imports which kept coming in with pink (a sign all is not well) where the transparency should have been checkered.
Admittedly this is a Paint Shop Pro specific solution but there may be others frustrated with PNG imports into Unity3d 5.6 Cheers!
Sorry but all problems you seem to have comes most likely from your Paint Shop Pro usage. I have used png files from various sources on the net, also created tons of pngs in gimp, Paint .NET, $$anonymous$$S Paint and Photoshop. I never ever had any problems with importing pngs in Unity. No matter if i import them in the editor or if i load them at runtime manually.
Answer by musicartslao · Aug 13, 2019 at 09:58 AM
I just solved this issue in Unity 2018.3.7 doing this:
open the png in Photoshop, change Mode from Index RGB
select and deleted the white background
change Mode from RGB to Index
export as PNG
import in Unity Sprite (2D and UI), Alpha source=> Input Texture Source, Alpha is Transparency
Generate Mip Maps => off
Hope this helps others !
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How to create a circle around a selected game object? 1 Answer
Issue with exr files on Unity. 1 Answer
How to make a 2D sprite that looks the same and to the same scale. 2 Answers
Built game error 0 Answers