-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Improve SVG thumbnails #9567
Comments
Wouldn't it be misleading to show the graphics in a different resolution than the one the asset will actually be drawn in? |
That's not how SVGs are represented in any mature apps, SVGs can be imported with many scales even if their base scale is 16x16. |
I thought the thumbnail respected the import scale, but testing it now shows it does not... |
Are we ever representing anything in the file system based on its import settings? I thought it was just supposed to be a good representation of the file itself, not how it's currently imported. And for SVGs the base truth would be what I described in the post |
I thought it was the opposite, but turns out it's not apparently 😅 . In that case, this proposal actually makes more sense then. |
Another argument for this would be the benefit of helping communicate that the SVG files are resolution independent vector graphics, to contrast with bitmap images that have a set pixel resolution. The current pixelated previews incorrectly seem to indicate the svg files have a set pixel resolution. |
I support this proposal, but it needs an implementation. Help wanted! |
If someone can guide me to the code for creating these previews is, I'll probably be able to implement it. |
Do a search for |
Describe the project you are working on
An SVG editor
Describe the problem or limitation you are having in your project
My icons folder looks like this, which is an eyesore.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Changing the SVG thumbnails creation method to not produce blurred outputs.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Currently it appears as though the SVG is just rendered and upscaled.
The best approach I can think of right now would be to make it so after the SVG is rendered onto an image, grab that image's width and height and discard it. Use them to calculate how much the image needs to be upscaled or downscaled to fit in the thumbnail precisely. Then use this scale as an argument when re-rendering the SVG, and use the re-rendered version.
The above could maybe be simplified if we have a way to grab the SVG's width and height without rendering the whole thing, or maybe there's even some way to render an SVG at a set size. I don't know. Also, if godotengine/godot#86022 goes through, maybe SVGTexture could help too.
In any case, it shouldn't be a performance killer, because the re-rendered SVGs have a set size, and we'll never need to render something big.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Will be used often.
Is there a reason why this should be core and not an add-on in the asset library?
Basic functionality of something already supported.
The text was updated successfully, but these errors were encountered: