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

Minimize images #89

Closed
sYnfo opened this issue Dec 21, 2019 · 5 comments
Closed

Minimize images #89

sYnfo opened this issue Dec 21, 2019 · 5 comments

Comments

@sYnfo
Copy link

sYnfo commented Dec 21, 2019

Are you planning to add an option to minimize/optimize images in addition to turning them off completely?

Thanks for creating this, by the way, it's super useful!

@snshn
Copy link
Member

snshn commented Dec 21, 2019

The idea I currently have in mind regarding file sizes is to have a default max file size, applicable to all types of media (audio, video, images), and then either minimize (images) or exclude (audio/video) files that exceed that limit. The file size limit will be adjustable via flags.

@Alch-Emi
Copy link
Contributor

Another approach to this might be using webp to re-encode and optimize images for size. While PNGs are still the dominant format, webp can often be a lot smaller, especially with compression set high enough.

This PNG image:
GitHub Imagey thing
compresses from 83K to 36K [41%] with the strongest level of lossless webp compression, and even more so to 24K [29%] at 60% quality lossy.

Considering that images represent a large amount of the filesize of current monoliths, this might be worth putting time into. That said, it doesn't look like there's a very good amount of support for webp in Rust yet, so maybe this is best put on the backburner?

@snshn
Copy link
Member

snshn commented Jan 13, 2020

I think it's a good idea to have images converted into one lossless format that takes up the least amount of space, as long as it's supported by all major browsers and if there are no issues like patents surrounding it. And I agree with @Alch-Emi that while scaling most image formats down to save space can be done with what Rust 's ecosystem has to offer as of now, converting them all into webp to save space might have to be delayed until Rust gets a good webp crate.

@grerrg
Copy link

grerrg commented Mar 10, 2020

Let's not forget the purpose of this tool is to archive and not alter the content.

Imho turning images off is a good idea but doing some image optimization isn't. I'd rather have the original information than saving 2mb per page.

@snshn
Copy link
Member

snshn commented Mar 11, 2020

@grerrg what you're saying sounds very reasonable. I rather follow the Unix philosophy and keep this tool as lightweight as possible. The idea of squeezing bytes out of archived pages still seems to be appealing, perhaps it could be done by running some other tool after the page's saved. Outside of the scope of this program, closing.

@snshn snshn closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants