-
Notifications
You must be signed in to change notification settings - Fork 48
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
Resize vectors to a max size #20
Comments
Will consider it! Sounds like a useful feature, although I am questioning whether it is outside the scope of the project (originally avdo was basically meant to be a slimmed down version of "svgo" except for vector drawables instead... svgo does provide some disabled-by-default-plugins that are not related to optimization... things like sorting attributes, adding prefixes to class names, etc... so maybe avdo could support custom plugins like that). At some point I want to make it possible for people to write their own custom plugins and have them be specified via command line, so I'll keep this in mind when I start thinking about how that would work! |
@PaulWoitaschek did you find a way to optimize the vectors to 200dp? |
Yes, you can just manually set the width to 200dp (and adjust the height by the appropriate factor). However if the target is actually larger than 200dp you should simply not use a vector drawable but a webp image. But it depends on the image - if it has a large padding you should remove it from the vector and set it on the view directly and then you can continue using the vector drawable. |
my target will be more than 200dp :( it is a full screen background. |
In https://medium.com/upday-devs/optimizing-the-performance-of-vector-drawables-680a4c456286
it's recommended to only use vectors with a maximum size of 200dp.
I suggest to have an optional flag to resize the xml files to that size (maybe passing the desired max dp) while maintaining the aspect ratio.
The text was updated successfully, but these errors were encountered: