leancodepl / flutter_webp

Asset transformer for converting images into WebP files.
https://pub.dev/packages/webp
Apache License 2.0
3 stars 0 forks source link
flutter webp

webp

webp pub.dev badge

Asset transformer for converting images into WebP files.

Install package

flutter pub add webp

Package usage

Add to your pubspec.yaml.

Default usage

If run without additional arguments, the default value of the quality parameter = 75 with lossy compression will be used.

flutter:
  assets:
    - path: assets/logo.jpg
      transformers:
        - package: webp

Usage with params

flutter:
  assets:
    - path: assets/logo.jpg
      transformers:
        - package: webp
          args: ['--quality=65', '--hint=graph', '--af']

By default, the package runs the embedded precompiled cwebp binary. You can use the one specified in your $PATH by adding the --from_path flag.

flutter:
  assets:
    - path: assets/logo.jpg
      transformers:
        - package: webp
          args: ['--from_path']

cwebp parameters

Here are some commonly used parameters for cwebp:

For a complete list of parameters and their descriptions, please refer to the cwebp documentation.

Supported architectures

The package provides cwebp binaries for the following architectures:

Note: You can still use the package on other architectures with cwebp from your $PATH.

Learn more


LeanCode

Built with ☕️ by LeanCode