white line in PNG images in Unity - image

I am currently making a simple game, but my assets even though they are png and there are no lines or anything with them before I export them, they keep having white lines when I put them in Unity.
The dialog box with white lines in Unity
This is the dialog box when viewed from the png file or from the resources
There is also one image tho it does not have any white line, it does have white edges in Unity
The phone asset in Unity
This is the phone when viewed from the file manager
Here are the import settings of both of the image
dialog box import settings
phone image import settings
What should I do to fix this in Unity?

I solved my problem by tweaking either the Wrap Mode or the Filter Mode.
In the dialog box or in the case of the white lines, when I change the wrap mode to Clamp, Mirror, or Mirror once, the line disappears as well as when changing the filter mode to Point(No filter).
In case of the white edges, Wrap Mode has no effect on it, it can only be removed when setting the Filter Mode to Point(No filter).

Related

Check if picture has white background

How can I detect if a picture has a white background or not using Intervention.
My project is using a lot of picture which are either from studio in a white lab environment, or lifestyle nature images.
I would like to use a script to determine which ones have a white background.
I don't need to change the pictures in any way.

Is there a way to change the background color of the xcassets view in Xcode 5 or Xcode 6?

Is there a way to change the background color of the xcassets view in Xcode 5 or Xcode 6?
I have white images that are lost on the white background.
When viewing an image without using xcassets, the image is set against a grey background.
However with xcassets the background is white and the images can't be seen.
I've tried using different different font and color schemes but they only seem to apply to the text editor.
A reasonable work around is to select the image asset, (eg click on the 1x or 2x version) and then press the spacebar.
This will show the asset in a popover with a light grey background.
If you are happy to add an Xcode plugin (it's available via Alcatraz) then
TOCAssetCatalogBackground solves this problem. https://github.com/toco/TOCAssetCatalogBackground
Are the images essentially silhouettes? If so, you could make them in another color (I like to use magenta, because then it’s immediately clear when something isn’t working). Then you can use iOS 7’s -[UIImage imageWithRenderingMode:] (not sure if there is a Mac equivalent) to have the image automatically pick up the tint color of its containing view. Then you would not be looking at white images on a white background.

Resized image does not appear in my project

I am developping a metro application on w8.
My splash screen image was too little and appeared just in the middle of the screen.
What is requiered is a 620*300 px image so I changed the dimensions of my picture and replace it in the project asset folder without changing the name, I looked in the properties the picture is in fact 620*300 pixels, there isn't any error in appmanifest file but when I launch the program the image size is the same, nothing has changed.
What I have to do?
That is expected behaviour. The image will appear in the center of the screen with the background colour you specify in the manifest surrounding it.

How do you set pixels to be transparent in a .GIF or .PNG file in Visual Studio 2008's drawing editor?

My graphic artist gave me a .PNG file, then the same file as a .GIF. When I save it, the transparent background pixels actually get set to white pixels. At one time I thought VS could do transparent colors with this little pink/salmon retro-tv looking icon in the color palette, but it's not showing up any more.
Anybody have any ideas?
Open the file gif/png with the Visual Studio Editor
In the properties window select a format that supports the alpha channel i.e. 32bpp BGRA
Using the eraser tool now will set those pixels to transparent.
In Visual Studio 2015 image editor, I found an easy way to do this with the eraser tool.
First fill the background which you want to make transparent with an adequately unique color(not really necessary I think, after some trials.. It's up to you to try) that is not in the picture.
Then select the tool used to 'select an area of similar color'.
Then click on the background you filled with new color. Only the area you need to make transparent will be selected.
Now use the eraser tool with as much size(erase width in properties) as you want to easily erase the opaque background. The eraser won't erase the picture you need.
Then click outside the picture to clear the selection and you get the picture with the transparent background! This method just takes seconds to finish, as compared to using just the eraser tool. Just sometimes, you may need to touch up the picture, as some minor part of required image may be cleared.
NOTE: You must set the format to '32bpp BGRA' to do this.
EDIT: I found that you don't even need an eraser tool. After step 3, press delete, and the background is gone!
In the VS 2013 image editor, the following works for me:
Select View-Toolbars-Image Editor so that you can see the toolbar
Select the eraser from the toolbar. Set the erase width in the property window to 1
Now clicking ("erasing") a pixel will set it to transparent
The VS eraser tool was working but taking way too long for my image. This tool automatically made my white background transparent when I uploaded the png version.
https://www.bonanza.com/background_burner
Drag and Drop image on page (then the page does some processing to
the image)
Click green download button on bottom right and select .png
(transparent background)
Pros:
Free
Super fast
Online tool so nothing to download
Con:
Image needs to be at least 100 x 100px
I'm just using it for an intranet web app so I didn't need to put much time in or make it great quality.
In the VS2019 image editor you can also use the "M" key on the keyboard to select an area of an image based on color, and then use the delete key.
If you have access to Microsoft Visio you can Import/Create the graphic object that you want to have some transparent pixels, make some or no changes to it and then Save As Type .png file.
After you hit Save As a PNG Output Options pop-up appears.
It gives you a Tick box to select the Transparency color (ie color you want to make transparent).

Icons editable in Visual Studio, but appear blank in other editors

Odd one, this. The project I'm working on includes some small icons (.ico file type) in a Windows resource (.rc) file, all 10x10 black on transparent.
Opening these icons in Visual Studio 2010 correctly brings up the icon editor, showing the icon in salmon-pink on teal-green. The icon's properties in VS show it as "10x10, 4 bit, BMP". The app that includes the icons displays them fine.
However, I cannot view or edit them in external editors! Windows 7 explorer's thumbnail view is blank white; MS Paint also loads them as 10x10 blank white images. Paint.Net (with the .ico plugin) thinks they're 10x10 transparent images. Windows file properties reports them as 10x10, 32-bit icons.
What's going on?
An icon contains 3 distinct bitmaps. Two monochrome ones and, in your case, a 4bpp bitmap. The monochrome bitmaps determine how the pixels are displayed. One of them determines whether a pixel is transparent, it shows up as teal green in the icon editor. The other determines whether a pixel is actually the background pixel inverted, it shows up as pink salmon in the icon editor.
So if you only see teal and pink then your 4bpp bitmap does not contribute anything at all to the visible icon. Whatever other icon viewer you are using to look at the icon is tripped up by that. Which is not unusual, inverting background pixels made only sense in the early days of Windows, back when displays had a very limited number of colors. Like 4bpp.
Fix it by using real colors in the 4bpp bitmap. Or don't worry about it if you are always displaying the icon on a well known background. Which is not typical btw, the user can change the color scheme setting for the window title bar for example. Or change the wall paper image for the desktop. The resulting icon color will be pretty random.

Resources