XuidUnity icon indicating copy to clipboard operation
XuidUnity copied to clipboard

Image importer is importing images in bad quality of image...

Open Inaki74 opened this issue 4 years ago • 7 comments

image

The image above has two of the same component.

The one on the left is a component from Adobe XD imported by hand, while the one on the right is one imported by XUID.

Now, I LOVE this plugin, but we can't use that quality of images Any idea of what to do here?

Inaki74 avatar Mar 25 '21 22:03 Inaki74

Thanks for using this! Adjust the scale in the Output Options. This is also the multiplier for the resolution of the image. image

It is recommended that you set Artboard size to the target resolution. If you do so, the Scale option is 1.

itouh2-i0plus avatar Mar 25 '21 23:03 itouh2-i0plus

Hi!

First and foremost, thanks for the Quick response!

Unfortunately though, this that you suggested doesn't work:

This is the image we get when we import manually to Unity (we exported from Adobe XD with XUID Unity Export, and imported by hand to unity): image

We have tried to export at bigger scales (x2 or x3) but a visual glitch appears when we import to Unity with the XUID Unity Importer: image

If we do what you suggested (setting the artboard to target resolution), the result within Unity is the following (again with XUID Importer): image

It sort of becomes "squared". In all cases, by importing by hand the visual glitch doesn't appear. Its important to note that the problem lies when we import into Unity, not when we export from Adobe XD. When we export from Adobe, the image has a good resolution and no visual glitches. These glitches appear when we import into Unity.

Again, thanks for your time!

Inaki74 avatar Mar 26 '21 14:03 Inaki74

Thank you for trying. Can I get some sample data? I want the XD file or the Unity project. I want both if possible.

I am thinking about the following possibilities

  • Problems when importing. (auto 9slice)
  • Compression for the target device.

itouh2-i0plus avatar Mar 26 '21 15:03 itouh2-i0plus

Hi! Once again, thanks for the Lightning quick response!

Unfortunately, Im sorry to say that I cannot share the projects due to privacy issues...

However we did get into investigating a bit.

We tried different target devices and compressions. The problem remains...

We tried creating a brand new Unity Project and (using the same Adobe XD export we used before, the one with your tool), installed XUID (same version) to it and then doing a Clean Import.

The result is this: image

The result is good! Which unfortunately means there is something wrong with importing into our main Unity Project...

We have compared the canvas settings, project settings and the sprite import settings between our main project and the new project, and all values are the exact same.

Now we are wondering if you could tell us which things to look for that you suspect might be causing the problem to help us resolve this. Any Unity Project Settings that XUID uses in its logic to do the import that might affect the auto 9slice or the compression.

Other things we noticed, in the faulty unity project sprites are imported with different borders and lower resolutions.

Thanks again for your time!

Inaki74 avatar Mar 26 '21 16:03 Inaki74

Glad to see the good results!

Here's what I predicted about the cause.

  1. For auto 9slice, I thought there might be some unknown behavior. I think this possibility is unlikely.
  2. I noticed that in the bad image the corners are gray. I think the Texture compression option may have made the alpha values less accurate.

image I tried to get close to the bad images.

  • Selected a sprite image.
  • Configure it in Inspector.
  • Reduce the MaxSize to lower the resolution.
  • By changing the Format, the transparency disappeared.  (I thought that Alpha going to 1 bit would make for a bad image.)

Even if the conversion is correct, get a bad image depending on the settings.

itouh2-i0plus avatar Mar 26 '21 22:03 itouh2-i0plus

Hi! Excuse our disappearance, holidays came and went but now we are back.

I played with the settings you pointed at on both projects, the faulted one and the clean one.

In the faulted project, no changes in the format would improve the quality: still doesn wooork

In the test project (the one with good importing) lowering quality and changing formats produces a much more meaningful effect: the other one

And as you can see, in the first one the gray corners are sort of like... part of the texture. Really weird.

Im not sure how to proceed...

Are there other project-related things that might be affecting XUID that I should be aware of?

Inaki74 avatar Apr 01 '21 14:04 Inaki74

I love the holidays too!👍

I've never had a problem with image importing going wrong depending on the project settings. So I am not sure what could be the cause.

  • Check for DIFF in the .settings file.
  • Copy the .settings file from a clean project What about this way?

So just importing a PNG image with alpha into a failing project is not a problem?

If so, can you try this? image

By adding .image.no-slice, the layer will become an image and the 9slice process will be skipped.

itouh2-i0plus avatar Apr 02 '21 11:04 itouh2-i0plus