@@ -36,11 +36,6 @@ export function yourImages() {
36
36
return gulp .src (' yourSrcImagePath' )
37
37
.pipe (
38
38
sharpOptimizeImages ({
39
- jpg: {
40
- quality: 100 ,
41
- progressive: false ,
42
- mozjpeg: true ,
43
- },
44
39
webp: {
45
40
quality: 80 ,
46
41
lossless: false ,
@@ -49,7 +44,13 @@ export function yourImages() {
49
44
quality: 100 ,
50
45
lossless: true ,
51
46
effort: 4 ,
52
- }
47
+ },
48
+ png_to_heif: {
49
+ quality: 90 ,
50
+ },
51
+ jpg_to_avif: {
52
+ quality: 50 ,
53
+ },
53
54
})
54
55
)
55
56
@@ -60,16 +61,48 @@ export function yourImages() {
60
61
## API
61
62
``` js
62
63
sharpOptimizeImages ({
63
- outputImageObject: {
64
+ outputImageExtname: {
65
+ param: value,
66
+ },
67
+ imageExtname_to_imageExtname: {
64
68
param: value,
65
69
},
66
70
})
67
71
```
68
72
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
70
94
Type: ` 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:
73
106
- ` png `
74
107
- ` jpg ` | ` jpeg `
75
108
- ` webp `
@@ -78,11 +111,5 @@ Supported format names:
78
111
- ` heif `
79
112
- ` gif `
80
113
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
-
87
114
### If you find a bug, please create an issue [ here] ( https://github.com/Ulyanov-programmer/gulp-sharp-optimize-images/issues ) .
88
115
### 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