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
[CLI] Add support for SVG input #884
Comments
I'd like to +1 this and just drop a use case here. We ship a web app with the ability for clients to customize whether or not it serves SVG or PNG icons. This means we ship SVG and PNG versions of the same icons; so the use case for us is to generate the PNG versions at build time from the SVGs. |
Design question: should it be a goal to be able to take an input SVG and vector-resize to any arbitrarily-sized raster format like PNG? Or would having a new "SVG" decoder return a bitmap at the intrinsic height and width of the SVG be a suitable initial goal? Also, I see there are a couple NPM modules that will rasterize SVG. Are there any license concerns specific to this project that are worth noting? If it's not clear, I'm investigating an implementation. :) |
Just like the web app, resizing should happen before rasterization. Re licensing: Anything that is Apache-2.0 or MIT should be no problem. Other licenses might work, but will be look at on a case-by-case basis. |
Just brain dumping some progress here. I was able to implement an SVG decoder using Puppeteer. But I'm not sure if it's going to be acceptable to make users incur the Chromium download just to use the CLI. Maybe we could conditionally download if we detect SVG input. So this may not be the best solution, but it was quick to implement and also means SVG rasterization happens the exact same way that it does in the web app. Other options:
|
Sharp translates SVG-to-___ just fine: |
Thanks for the resource @tomByrer! I'll take a look |
Housekeeping Note (ignore me !) : we consider this may be complex and long-running project. We may need to break down tasks more. |
Unfortunately, due to a few people leaving the team, and staffing issues resulting from the current economic climate (ugh), the CLI and libsquoosh packages are no longer actively maintained. I know that sucks, but there simply isn't the time & people to work on this. If anyone from the community wants to fork it, you have my blessing. The squoosh.app web app will continue to be supported and improved. |
No description provided.
The text was updated successfully, but these errors were encountered: