You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All generated images will be placed into the `public/assets` path of your application.
57
54
55
+
### Usage with custom quality
56
+
57
+
The Sharp library uses default quality values depending on the output format. If the file type [supports it](https://sharp.pixelplumbing.com/api-output/#toformat), you may pass an optional `quality: [number]` in your image object array:
58
+
59
+
```js
60
+
images: [
61
+
{
62
+
inputFilename:'public/trapezoid.svg',
63
+
outputFileName:'icon-trapezoid',
64
+
convertTo:'png',
65
+
sizes: [32, 48, 192],
66
+
quality:50,
67
+
}
68
+
]
69
+
```
58
70
59
71
### Usage in a template
60
72
@@ -73,12 +85,12 @@ All generated images will be placed into the `public/assets` path of your applic
73
85
|`sizes`| :heavy_check_mark: | none | `[92, 150]` | An array of image sizes to produce |
74
86
|`destination`| | `assets/icons` | `images/wherever/you/want` | The destination directory for the output images relative to `/public` |
75
87
|`background`| | none | `{r:255, g:255, b:255, alpha:0}` | Add a background color to the image. |
88
+
|`quality`| | varies by format | `25` | The quality (out of 100) of the image processing. |
76
89
77
90
## Contributing
78
91
79
92
See the [Contributing](CONTRIBUTING.md) guide for details.
80
93
81
-
82
94
## License
83
95
84
96
This project is licensed under the [MIT License](LICENSE.md).
0 commit comments