@@ -36,11 +36,6 @@ export function yourImages() {
3636 return gulp .src (' yourSrcImagePath' )
3737 .pipe (
3838 sharpOptimizeImages ({
39- jpg: {
40- quality: 100 ,
41- progressive: false ,
42- mozjpeg: true ,
43- },
4439 webp: {
4540 quality: 80 ,
4641 lossless: false ,
@@ -49,7 +44,13 @@ export function yourImages() {
4944 quality: 100 ,
5045 lossless: true ,
5146 effort: 4 ,
52- }
47+ },
48+ png_to_heif: {
49+ quality: 90 ,
50+ },
51+ jpg_to_avif: {
52+ quality: 50 ,
53+ },
5354 })
5455 )
5556
@@ -60,16 +61,48 @@ export function yourImages() {
6061## API
6162``` js
6263sharpOptimizeImages ({
63- outputImageObject: {
64+ outputImageExtname: {
65+ param: value,
66+ },
67+ imageExtname_to_imageExtname: {
6468 param: value,
6569 },
6670})
6771```
6872
69- ### outputImageObject
73+ ### outputImageExtname
74+ Type: ` object ` <br >
75+ An object that allows you to convert ` all ` images into images of a ` specific type ` .
76+ <br >
77+ Optimizes and transmits the original.
78+ <br >
79+
80+ ``` js
81+ // example, all images will be converted to avif
82+ avif: {
83+ param: value,
84+ },
85+ ```
86+
87+ #### param
88+ Type: ` any ` (depends on the parameter)<br >
89+ Option for an output image. <br >
90+ To get acquainted with all the available parameters, please take a look:
91+ https://sharp.pixelplumbing.com/api-output#jpeg
92+
93+ ### imageExtname_to_imageExtname
7094Type: ` object ` <br >
71- An object containing the name (format name) of an output image and its properties. <br >
72- Supported format names:
95+ An object that allows you to convert images of a ` specific type ` into images of a ` specific type ` . <br >
96+ Does not transmit the original. <br >
97+
98+ ``` js
99+ // example, all images in the format .jpg will be converted to .heif
100+ jpg_to_heif: {
101+ param: value,
102+ },
103+ ```
104+
105+ ### Supported format names:
73106- ` png `
74107- ` jpg ` | ` jpeg `
75108- ` webp `
@@ -78,11 +111,5 @@ Supported format names:
78111- ` heif `
79112- ` gif `
80113
81- ### param
82- Type: ` any ` (depends on the parameter)<br >
83- Option for the output image. <br >
84- To get acquainted with all the available parameters, please take a look
85- https://sharp.pixelplumbing.com/api-output#jpeg
86-
87114### If you find a bug, please create an issue [ here] ( https://github.com/Ulyanov-programmer/gulp-sharp-optimize-images/issues ) .
88115### If this project was useful to you, you can give it a ★ in [ repository] ( https://github.com/Ulyanov-programmer/gulp-sharp-optimize-images ) .
0 commit comments