{"id":20802242,"url":"https://github.com/ulyanov-programmer/gulp-sharp-optimize-images","last_synced_at":"2026-03-09T20:33:09.006Z","repository":{"id":65389643,"uuid":"590787239","full_name":"Ulyanov-programmer/gulp-sharp-optimize-images","owner":"Ulyanov-programmer","description":"Compression and conversion of images for gulp using sharp.","archived":false,"fork":false,"pushed_at":"2024-04-22T15:37:54.000Z","size":33,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T05:23:28.772Z","etag":null,"topics":["avif","compress","convert","converter","gulp","image","images","jpg","png","sharp","webp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ulyanov-programmer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-19T07:52:55.000Z","updated_at":"2025-08-10T10:03:32.000Z","dependencies_parsed_at":"2024-04-14T10:35:49.037Z","dependency_job_id":"12943c02-2ea0-445d-b1eb-06695220f8e9","html_url":"https://github.com/Ulyanov-programmer/gulp-sharp-optimize-images","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Ulyanov-programmer/gulp-sharp-optimize-images","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulyanov-programmer%2Fgulp-sharp-optimize-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulyanov-programmer%2Fgulp-sharp-optimize-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulyanov-programmer%2Fgulp-sharp-optimize-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulyanov-programmer%2Fgulp-sharp-optimize-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ulyanov-programmer","download_url":"https://codeload.github.com/Ulyanov-programmer/gulp-sharp-optimize-images/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulyanov-programmer%2Fgulp-sharp-optimize-images/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273886624,"owners_count":25185507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avif","compress","convert","converter","gulp","image","images","jpg","png","sharp","webp"],"created_at":"2024-11-17T18:29:04.175Z","updated_at":"2025-09-06T09:41:29.179Z","avatar_url":"https://github.com/Ulyanov-programmer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-sharp-optimize-images\n\nTested and works with gulp `5.0.0` and `4.0.2`.\n\n\u003e Compression and conversion of images for gulp using [sharp](https://www.npmjs.com/package/sharp).\n\n## What is this\n\n### With this thing you can: \u003cbr\u003e\n\n- Optimize your images.\n- Convert your images to other formats (including, but not limited to `.webp` and `.avif`).\n\n### Features\n\n- Using the [sharp](https://www.npmjs.com/package/sharp) plugin.\n- Has a minimum of dependencies.\n- Supported formats: `.png .jpg/jpeg .webp .avif .tiff .heif .gif`\n\n## Why is this\n\n- [imagemin](https://www.npmjs.com/package/imagemin) is unmaintained, [see the issue](https://github.com/imagemin/imagemin/issues/385).\n- [gulp-libsquoosh](https://www.npmjs.com/package/gulp-libsquoosh) uses the outdated library [@squoosh/lib](https://www.npmjs.com/package/@squoosh/lib), which does not have support for node \u003e 16.0.0. In addition, the squoosh lib is no longer maintained.\n- [@donmahallem/gulp-sharp](https://www.npmjs.com/package/@donmahallem/gulp-sharp) does not have normal documentation.\n\n## How to use this\n\n### Installation\n\n```\nnpm i --D gulp-sharp-optimize-images\n```\n\n_OR_\n\n```\nyarn add gulp-sharp-optimize-images -D\n```\n\n---\n\n### Example of usage\n\n```js\nimport sharpOptimizeImages from 'gulp-sharp-optimize-images';\nimport gulp from 'gulp';\n\nexport function yourImages() {\n  return gulp\n    .src('yourSrcImagePath')\n    .pipe(\n      sharpOptimizeImages({\n        webp: {\n          quality: 80,\n          lossless: false,\n          alsoProcessOriginal: true,\n        },\n        avif: {\n          quality: 100,\n          lossless: true,\n          effort: 4,\n        },\n        jpg_to_heif: {\n          quality: 90,\n        },\n        png_to_avif: {},\n\n        jpg_to_jpg: {\n          quality: 80,\n          mozjpeg: true,\n        },\n      })\n    )\n\n    .pipe(gulp.dest('yourDistImagePath'));\n}\n```\n\n## API\n\n```js\nsharpOptimizeImages({\n  outputImageExtname: {\n    param: value,\n  },\n  imageExtname_to_imageExtname: {\n    param: value,\n  },\n});\n```\n\n### outputImageExtname\n\nType: `object`\u003cbr\u003e\nAn object that allows you to convert `all` images into images of a `specific type`.\n\u003cbr\u003e\nAlso optimizes and transmits the original.\n\u003cbr\u003e\n\n```js\n// example, all images will be converted to avif.\navif: {\n  // If true, the originals will also be optimized and transferred.\n  alsoProcessOriginal: false,\n\n  param: value,\n},\n```\n\n#### param\n\nType: `any` (depends on the parameter)\u003cbr\u003e\nOption for an output image. \u003cbr\u003e\nTo familiarize yourself with the available options, refer to the plugin documentation (for example, this section for .jpeg):\nhttps://sharp.pixelplumbing.com/api-output#jpeg\n\n#### alsoProcessOriginal\n\nType: `boolean`\u003cbr\u003e\nDefault value: `false`\u003cbr\u003e\nIt also allows you to optimize and move the original file. It only works for the type `outputImageExtname: {}` parameter. \u003cbr\u003e\n\n### imageExtname_to_imageExtname\n\nType: `object`\u003cbr\u003e\nAn object that allows you to convert images of a `specific type` into images of a `specific type`. \u003cbr\u003e\nDoes not transmit the original. \u003cbr\u003e\n\n```js\n// example, all images in the format .jpg will be converted to .heif\njpg_to_heif: {\n  param: value,\n},\n// you can also optimize images without changing the extension\njpg_to_jpg: {\n  param: value,\n},\n```\n\n### logLevel\n\nType: `string`\u003cbr\u003e\nDefault value: `small`\u003cbr\u003e\nCan get the value: `small | full | ''`\u003cbr\u003e\nAllows you to change the logging.\n\n```js\n// usage example\nsharpOptimizeImages({\n  logLevel: 'small',\n  ...\n});\n```\n\n```bash\n// Log if the value of logLevel is equal to 'small' (default value):\nyourImage.jpg =\u003e webp\n\n// Log if the value of logLevel is equal to 'full':\nThe file the_absolute_path_to_your/image.jpg was processed to image.webp\n\n// Log if the value of logLevel is equal to '' (or other value):\n\n(the log is disabled)\n```\n\n### Supported format names:\n\n- `png`\n- `jpg` | `jpeg`\n- `webp`\n- `avif`\n- `tiff`\n- `heif`\n- `gif`\n\n### If you find a bug, please create an issue [here](https://github.com/Ulyanov-programmer/gulp-sharp-optimize-images/issues).\n\n### If this project was useful to you, you can give it a ★ in [repository](https://github.com/Ulyanov-programmer/gulp-sharp-optimize-images).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulyanov-programmer%2Fgulp-sharp-optimize-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulyanov-programmer%2Fgulp-sharp-optimize-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulyanov-programmer%2Fgulp-sharp-optimize-images/lists"}