This may be redundant, but my searches came up empty, so hopefully this is something useful! A Photoshop (or PNG) with alpha will have a white fringe in Unity (especially if viewed large). The Wiki has a great PDF tutorial that changes the fringe from white to black, which can be less noticeable, but is still a problem with light textures on light backgrounds, or when textures are viewed greatly enlarged.
EDITED: SEVERAL IMPROVEMENTS MADE TO THE PROCESS.
This Photoshop procedure will insure there is NO fringe at all. (It makes the semi-transparent fringe pixels have the true intended colors of the image, and then surrounds them with an additional layer of similar pixels for when the alpha channel is greatly enlarged causing it to bleed). It also works without needing to save a second copy of the image:
-
View your Photoshop document with a transparent background, as intended, and Select All.
-
Copy Merged (Command-Shift-C), then Paste to create a new layer (drag to the top of the list if you wish).
-
Align the new layer precisely with the rest of the document (double-click Magnify to insure 100% view, use Move tool and arrow keys to nudge; Difference mode can help align–it goes black when perfectly aligned).
-
Option-click the new layer’s eye icon (to hide all other layers). Then Command-click the layer to get a marquee.
-
From the menus, choose Select > Save Selection (no name is needed) to store the alpha channel. Hit Command-D to deselect.
-
Repeat the following pair of actions EIGHT times (jagged edges will appear):
a. Drag the layer to the New/Duplicate icon (turning page) at the bottom.
b. Press Command-E (Merge Down). -
Make four more duplicates (don’t merge) and nudge (arrow keys) the bottom four copies (NOT the top copy) one pixel in the four directions. Nudge one layer up, one down, one left, and one right.
-
If you have a Background layer with the name in italics, make it visible. If you don’t, make a black (or other color) empty background layer and choose Layer > New > Background From Layer. (Without a true italicized Background layer, Unity will not use your alpha channel.)
The document will now be fringe-free in Unity.
When you need to make changes, discard the alpha channel and the newly-created top layers, make your changes, and repeat the steps.
Additional tip: a slight black fringe can actually help a foreground object stand out. But the usual “accidental” fringe is uneven, appearing only in places. To get a perfect hairline edge, add this step BEFORE making all the duplicate layers:
5a. Make an extra duplicate of the layer (separate from all other steps), on top, and add a Stroke. Color = black (or other color), size = 2 pixels (or try more–actual line will be half that), position = Center (important). Opacity sets how strong the edge is: try 100% for a distinct (thin) line, or 50% for some extra edge sharpness without looking like an obvious line.
Quick keyboard version:
- Command-A, Command-Shift-C, Command-V.
- Align layer at 100% view (v for Move). Option-click eye.
- Command-click layer, Select > Save Selection, Command-D. (3a. Add stroked layer if desired.)
- 8 x ( Duplicate layer, Command-E )
- 4 x Duplicate layer, nudge all but the topmost (up/down/left/right)
- Make sure you have an italicized Background.
(The alignment step is the problem with creating a recorded Action–I can’t get Photoshop to paste back in the same location that was copied from, so you must align manually. The rest could be an Action once I’m sure this is the best process.)
That’s all kind of a pain, especially when you need to make changes and have to repeat the process. True native alpha processing in Unity (which took the soft edge pixels at their true RGB values instead of mixing to white) would be great someday. But this is the best process I can come up with that truly has perfect results. Am I making this needlessly difficult? Is there a better way to have zero fringe? If not, I’ll add this to the Wiki!