Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Quality/Resolution #81

Closed
Carln02 opened this issue Jan 21, 2023 · 5 comments
Closed

Image Quality/Resolution #81

Carln02 opened this issue Jan 21, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Carln02
Copy link

Carln02 commented Jan 21, 2023

Hello!
I started checking out your library recently and I encountered a small issue with images. Both non-rectangular PNGs and SVGs appear pixelated and low resolution, no matter how high the original resolution of the image is. Below you can find a screenshot of what I'm talking about. The star's image file is a 1028 by 1028px PNG.

Screenshot 2023-01-21 143724

Thank you!!

@KurtGokhan
Copy link
Member

Can you provide the following information?

  • What is the React code used to generate this behavior?
  • How are you providing the image source? If it is an asset inside Unity, what are your import settings? Can you send that asset and its .meta file? (Some compression, mipmap or filter mode settings can cause this behavior)
  • Does this happen without ReactUnity? Can you try creating a simple UGUI image and try to reproduce it?

@Carln02
Copy link
Author

Carln02 commented Jan 21, 2023

  1. The code is quite long, but if I run the following in the index file:
import picture from "src/assets/icons/--primary-main/star-filled.png";
export function App() {
   return (<image source={picture} style={{width: '100px', height: '100px'}}/>);
}
Renderer.render(<App />);

I get the same pixelated output:
Screenshot 2023-01-21 173225

  1. Can I access images from the "Assets" folder? Whenever I try to input a path that goes outside the "src" folder in the react project I get an error. The image is placed inside this src folder and it doesn't have a .meta file.

Here is the asset:
star-filled

  1. If I place the same image as a 2D sprite in Unity it looks perfectly fine.

And thank you so much for the help!

@KurtGokhan KurtGokhan added bug Something isn't working pending fix This issue is already fixed, but not released yet. labels Jan 21, 2023
@KurtGokhan
Copy link
Member

I see. Image imports from file are imported with some default settings. I changed those settings to maximize quality now.

Fixed on main branch. I won't release a new version urgently as the problem only exists in development. In build, you have to go to the build folder and modify image import settings manually anyway.

@Carln02
Copy link
Author

Carln02 commented Jan 21, 2023

Oh okay great!! Thank you for your help :)

@KurtGokhan KurtGokhan removed the pending fix This issue is already fixed, but not released yet. label Feb 6, 2023
@KurtGokhan
Copy link
Member

Forgot to update, this is already fixed in 0.14.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants