9 ms·
Squoosh: Make images smaller using best-in-class codecs, right in the browser
- GavinAnderegg 6y agoI've been listening to the HTTP 203 podcast, which is presented by two people who worked on this project. The most recent episode has some great discussions about some of the newer image formats. Well worth a listen! https://http203.libsyn.com/ https://http203.libsyn.com/
- warp 6y agoThey also host HTTP 203 videos on specific topics on Youtube, which are also excellent. For example here is a video about the different Javascript APIs you could use to keep an app in sync across multiple tabs or devices: https://www.youtube.com/watch?v=9UNwHmagedE https://www.youtube.com/watch?v=9UNwHmagedE
- jaffathecake 6y agofwiw, we did a video on image compression a while back, but it wasn't part of the 203 series https://www.youtube.com/watch?v=F1kYBnY6mwg https://www.youtube.com/watch?v=F1kYBnY6mwg
- est31 6y agoAnother talk that goes into the design of squoosh: https://www.youtube.com/watch?v=ipNW6lJHVEs https://www.youtube.com/watch?v=ipNW6lJHVEs
- matylla 6y agoCheck out https://optidash.ai https://optidash.ai if you need an API for this.
- austinhutch 6y agoThe Squoosh folks are in here so I just want to say thank you it is a fantastic piece of software
- dassurma 6y ago<3
- BugsJustFindMe 6y agoI want it to be smarter and choose quasi-optimal settings for me automatically. Dropping an almost entirely solid white PNG on it, the initial suggestion is to convert to JPEG which _increases_ the size rather than decreasing it!
- dassurma 6y agoThe goal of Squoosh is more to teach out about all the options and levers codecs have. JPEG is not “suggested”, it’s just literally the first codec we ported to Wasm so that’s the auto-selected one :D The Squoosh CLI has an auto-optimizer that will make an image as small as possible while staying under a given Butteraugli threshold, but you still have to decide on the format yourself. https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli
- molszanski 6y agohttps://www.industrialempathy.com/posts/avif-webp-quality-settings/ https://www.industrialempathy.com/posts/avif-webp-quality-se...
- jaffathecake 6y agoIf anything, it's getting harder to choose the 'right' format https://jakearchibald.com/2020/avif-has-landed/#why-not-lossy https://jakearchibald.com/2020/avif-has-landed/#why-not-loss...
- seoaeu 6y agoThat page is rather deceptive because the images it uses are 1920x1080, but they are displayed after downsampling them to be much smaller. This masks the substantial blurriness introduced by lower quality levels of AVIF. If you zoom into the full resolution versions you can see that the road surface actually has a lot of roughness, but the compressed version makes the road look smooth.
- jaffathecake 6y agoThose images are displayed at the correct size for high density devices. Real users don't zoom in and compare to the original.
- pornel 6y agoThis is the best app for WASM. Integration of so many complex codecs and CPU-heavy optimizations used to be possible only in native apps.
- josephg 6y agoIt’s possible in javascript, but the best thing about wasm is that we don’t have to rewrite all this code in javascript, or suffer the performance penalties of doing so. If it already works in C, we can compile and ship that straight to the browser.
- sixothree 6y agoI am used to compression percentages being the percentage of the original file size, not some sort of inverse.
- jaffathecake 6y agoOne of the Squoosh developers here: I agree, but it's an argument I lost. This sort of thing really divides people it seems.
- toxik 6y agoIt makes sense to say it's x% smaller. It's clear what the UI means anyway.
- dassurma 6y agoThe difficulty is: Do you express the resulting file size or the amount saved? “30%” could mean you “30% of the original file size” or “you shaved off 30% of the original file size”. You could denote the difference with a sign, like “-30%” but that still confuses people. We ran both options by a lot of our colleagues. “x% of the original file size” is the least ambiguous, but who has the space to put that entire phrase in their app :-/
- alpaca128 6y ago> You could denote the difference with a sign, like “-30%” but that still confuses people How? This doesn't seem to be a problem whenever a shop runs a sale. You could write "shrunk by/to x%". Or, to stay with the app's theme, "Squooshed by 30%!"
- phailhaus 6y agoI use this site as my go-to example whenever I talk about webassembly. Absolutely fantastic demonstration of new possibilities!
- late_groomer 6y agoOne of my browser tabs is always open to Squoosh, it's an awesome tool. If only I could hook Squoosh in during Hugo site builds...(looks like that might be possible with their CLI, hopefully some whip-smart kid with lots of free-time figures it out for me).
- ac29 6y agoSeems like it would be fairly trivial to write a bash script that ran the hugo build, then optimized the images with the squoosh cli. Squoosh is available in npm, which should make this pretty easy: https://www.npmjs.com/package/@squoosh/cli https://www.npmjs.com/package/@squoosh/cli
- slig 6y agoIs there a good way to run this on a S3 bucket?
- dassurma 6y agoDo you mean serve the app from an S3 bucket? It’s a fully static site without any server-side components, so go nuts. If you mean compress all images in an S3 bucket? Not directly. But we do have a Squoosh CLI! https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli
- molszanski 6y agoI also love Squoosh. A fantastic peace of software
- simonw 6y agoSquoosh is the thing that really made me "get" WASM - it helped me understand that WASM suddenly makes the best-in-breed libraries for pretty much everything available to me in the browser, provided they can be compiled to it. And the WASM sandbox should be airtight, which means it's much safer to run C code in WASM than directly! I'm mainly a Python developer, so an accompanying revelation was that projects like wasmer-python then give me the same opportunity in my default environment - call out to best-in-breed C/Rust/etc libraries without the risk and misery of needing to compile and package them as Python extensions. Instead, wait for the JavaScript WASM community to figure out how to use them and take advantage of their work from my Python projects as well.
- lanna 6y ago> which means it's much safer to run C code in WASM than directly Anything is safer than to run C code directly ;)
- deleted 6y ago[deleted]
- thaumasiotes 6y agoWhat is the difference between WASM (new/good) and Java applets (old/bad)?
- afiori 6y agoThey try to do completely different things, it would be more meaningful to compare wasm with asm.js (let's try to improve a dynamic JITted language as a compilation target with simple semantics) and Java with Rust (let's try to make a language you could write anything in). Java/JVM is a strong compilation target but it is mainly a language and an ecosystem, wasm is building an impressive ecosystem but it is mainly a compilation target designed to be easily embeddable anywhere. Essentially the only things they have in common is the "run everywhere" slogan. To actually answer your question with my opinions: - wasm has a stronger sandbox and will (likely) never have any runtime reflection capability - wasm is primarily meant to be easily embedded/interpreted - wasm is extremely small - it offers no new functionality that isn't already present in javascript (this will eventually become false) - wasm lives within the sandbox of the browser - it is standardized together with javascript inside the web platform, not as a separate entity
- jerrygoyal 6y agohappy squoosh user here. It's my go to image compressor for png/jpeg. I've tried many compressors but it performs well overall. I hope google team also add support for GIF compression, currently I'm using https://gifcompressor.com https://gifcompressor.com Also, it would be convenient if there's a native Windows client which gives the option to select and compress images using context menu itself.
- dassurma 6y agoThe thing with GIF is that it’s rarely better than a paletted PNG. As for animations, video formats with a very low fps are usually way better suited and smaller than GIFs.
- RyanShook 6y agoWhy isn't Google's involvement in this more clearly explained?
- dassurma 6y agoHi! Squoosh team lead here :) What kind of explanation would you like to see? We link to the repo and the Privacy explainer at the bottom of the page. Why is it important to you to know that it’s made by Googlers?
- fnord77 6y agobecause rightly or wrongly, people are starting to distrust big tech companies.
- jaffathecake 6y agoIt's open source. Please take a look for anything you might distrust.
- dheera 6y agoWorking for a big tech company doesn't mean you represent them in everything you do in your off-hours.
- whatshisface 6y agoWhat are they going to do, watermark all of your images with subliminal messages about never using Bing?
- jturpin 6y agoThis is really cool and I appreciate the JpegXL support as well, even if it's not super well supported right now. I recently moved all of my photos from Dropbox to a local Nextcloud and I have a bunch of old photos that I don't want to delete, but don't need to be taking up gigabytes either. I can definitely get some good use out of this.
- jaffathecake 6y agoApparently JXL will support lossless conversion from JPEG to JXL (it won't be as compressed as full JXL, but it will be better than standard JPEG).
- qdiencdxqd 6y agoI wish there was something like this for video codecs!
- PhillyG 6y agoThat name is perfection. Kudos to whoever came up with it!