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

[Feature]: Convert non-lossy images to lossy Webp on drop. #5041

Open
FullBleed opened this issue Nov 11, 2024 · 2 comments
Open

[Feature]: Convert non-lossy images to lossy Webp on drop. #5041

FullBleed opened this issue Nov 11, 2024 · 2 comments
Labels
feature Adding functionality that adds value

Comments

@FullBleed
Copy link

Describe the Problem

Users are often using bloated file types (png, tif, bmp, etc.) without knowing that converting to a lossy compression format (like Webp) would save them a ton of space. This also reduces the size of the campaign files significantly and speed up auto saves and transfers to clients.

The Solution you'd like

When dropping an asset, have a "default on" check box to convert non-lossy images to a lossy webp images. Put the image quality conversion setting (0-100) in preferences>application. I'd suggest a 70% default.

Alternatives that you've considered.

At least warn users when importing non-lossy images that they should convert the images to webp... and then let them figure out how on their own. ;)

Additional Context

This does not address the problem of users using way more resolution than necessary and will not reduce memory usage.

@FullBleed FullBleed added the feature Adding functionality that adds value label Nov 11, 2024
@kwvanderlinde
Copy link
Collaborator

kwvanderlinde commented Nov 22, 2024

I don't really use WebP a lot (ever) so I had to see just how good this could be. I manually converted my campaign full of PNG assets to WebP, trying both lossless and 70% quality lossy. Results:

PNG (original) WebP Lossless WebP Lossy 70%
Asset total on-disk 173.9 MB 87.1 MB 17.1 MB
Campaign size on-disk 157.5 MB 88.9 MB 18.8 MB

If that kind of result is normal, and if there's no real downside to using WebP, then I'd like to see us use WebP as the serialized format for image assets. It would clearly help a lot for heavier campaigns. Only thing is that I'd prefer to keep assets lossless by default if the incoming format is lossless. Then let users explicitly say they want to allow lossy conversion at some preferred quality.

@FullBleed
Copy link
Author

FullBleed commented Nov 22, 2024

I don't really use WebP a lot (ever) so I had to see just how good this could be. I manually converted my campaign full of PNG assets to WebP, trying both lossless and 70% quality lossy. Results:
PNG (original) WebP Lossless WebP Lossy 70%
Asset total on-disk 173.9 MB 87.1 MB 17.1 MB
Campaign size on-disk 157.5 MB 88.9 MB 18.8 MB

If that kind of result is normal, and if there's no real downside to using WebP, then I'd like to see us use WebP as the serialized format for image assets. It would clearly help a lot for heavier campaigns. Only thing is that I'd prefer to keep assets lossless by default if the incoming format is lossless. Then let users explicitly say they want to allow lossy conversion at some preferred quality.

Definitely typical. WebP is such a nice format. I wouldn't fight the "lossless by default" approach so long as we have some kind of easy method to convert to lossy. As you can see, the lossless-to-lossless savings is good... while lossless-to-lossy is incredible (and, to my eyes, I can hardly tell the 70-80% rate unless I go pixel peeping.)

Note: If you default to lossless, you'll need to make an exception for jpgs (which is a lossy format without an alpha channel). Converting a jpg to a non-lossy WebP will actually blow things up considerably.

Quick test on a large JPG map (9500x7000):

Original JPG : 9072kb
WebP Lossy (70%) : 5945kb
WebP Lossless: 68637kb

I don't know what the jpg quality setting was for the original image (probably 70-80%)... but a 7.5x increase in size would be the exact opposite of what we're going for here. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding functionality that adds value
Projects
None yet
Development

No branches or pull requests

2 participants