PNG Scaling

Hi, I’m trying to get my PNG images to look the same in game mode as they do in my image editor. I’m using Adobe Illistrator CC to create vector images. They’re nice and crisp. I export them as a PNG file, drop it in unity as an asset and drop it in the scene view. When i press play it looks kind of crappy, like its being condensed or something.

I think it is because the Game View is actually a little smaller then my window and so its being crushed slightly.

Is there a way to insure my images will show up nice and crisp as they do before I add them to the game?

I understand its not a vector image when it arives in the game but i don’t zoom or shrink. I’m making the picture the size I want it to show up in the game, i would like to be able to just drop it in and have it look the same.

Any advice?

Thanks!!

  • Does your output rect (in screen coords) have the same size as PNG does?
  • Does it depends on screen resolution?
  • Does your texture have GUI import type?

if Yes/No/Yes - I guess it would looks the same. Else it may not.

Go to the inspector settings of the image (don’t select under the “hierarchy” tab, but rather select it under the “project” tab. If you want it to be pixel perfect, change the filter mode to “point”, otherwise, for gradient, smooth images, choose bilinear.

Then, ensure which platform your developing for (ctrl + shift + b on windows. switch after selecting your desired platform if necessary), and then in the inspector, under filter mode, ensure that your platform of choice recognizes the highest dimension in width or height your sprite is using. So if your sprite is 512 x 10, use the 512 max Size option, and choose “16 bit” if it’s pixel based or “true color” if it’s something like a gradient painting.

Default is not a platform, so ensure to cycle through the tabs, find your appropriate platform, and override for it. Unless it’s the same size across them all, in which case you can allow deafult to construct them all–just ensure that its at least at the right dimension, after the options you set under default do their work.

  1. find out what your build settings are (android? web? ios?)
  2. select the image in your project tab
  3. change its filter mode to bilinear / point based on your image type
  4. Ensure that “Default” supports your max image size. Override to optimize performance across other platforms where necessary (adnroid? web? ios?).
  5. Apply the settings.

Helpful tips:

  1. alter the sprite’s pixels to units to manage its size. Don’t use the transform property, as that will effect the graphics card of the device you’re using (and therefor decrease performance).
  2. Ensure you are in 2D mode before dropping a sprite into the scene.
  3. png’s which are large in pixel size, that are scaled down dramatically in the game view, will appear to be fuzzy. If you have them set up appropriately in the inspector, they will not build in that fuzzy state. Select “Maximize on Play” to ensure you’re getting the largest image possible, and that your bilinear filter mode png sprites are not appearing blurry just because they are being crunched down from a much higher pixel amount.