{"id":13447708,"url":"https://github.com/vseventer/sharp-cli","last_synced_at":"2025-04-09T05:09:10.660Z","repository":{"id":2030580,"uuid":"45531400","full_name":"vseventer/sharp-cli","owner":"vseventer","description":"CLI for sharp.","archived":false,"fork":false,"pushed_at":"2024-09-13T01:38:45.000Z","size":652,"stargazers_count":191,"open_issues_count":10,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T04:02:16.460Z","etag":null,"topics":["cli","image","image-processing","jpeg","libvips","png","sharp","svg","tiff","webp"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vseventer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2015-11-04T10:23:04.000Z","updated_at":"2025-03-04T16:37:57.000Z","dependencies_parsed_at":"2024-06-18T13:51:04.493Z","dependency_job_id":"0b9f4da4-777a-4e87-9a03-bf41b68abc1a","html_url":"https://github.com/vseventer/sharp-cli","commit_stats":{"total_commits":192,"total_committers":4,"mean_commits":48.0,"dds":0.046875,"last_synced_commit":"e567896826b8a035ce8fb58527556399f0bca1e5"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fsharp-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fsharp-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fsharp-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseventer%2Fsharp-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vseventer","download_url":"https://codeload.github.com/vseventer/sharp-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"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","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":["cli","image","image-processing","jpeg","libvips","png","sharp","svg","tiff","webp"],"created_at":"2024-07-31T05:01:24.918Z","updated_at":"2025-04-09T05:09:10.638Z","avatar_url":"https://github.com/vseventer.png","language":"JavaScript","readme":"# sharp-cli\n\u003e CLI for [sharp](https://www.npmjs.com/package/sharp), a high performance Node.js image processing module.\n\n## Install\n`$ npm install sharp-cli`\n\n## Usage\n```\nsharp \u003coptions\u003e [command..]\n\nCommands:\n  sharp affine \u003cmatrix..\u003e                      Perform an affine transform on an image\n  sharp bandbool \u003coperator\u003e                    Perform a bitwise boolean operation on all input\n                                               image channels (bands) to produce a single channel\n                                               output image\n  sharp blur [sigma]                           Blur the image\n  sharp boolean \u003coperand\u003e \u003coperator\u003e           Perform a bitwise boolean operation with operand\n                                               image\n  sharp clahe \u003cwidth\u003e \u003cheight\u003e                 Perform contrast limiting adaptive histogram\n                                               equalization CLAHE\n  sharp composite [images..]                   Composite image(s) over the processed (resized,\n                                               extracted etc.) image\n  sharp convolve \u003cwidth\u003e \u003cheight\u003e \u003ckernel..\u003e   Convolve the image with the specified kernel\n  sharp ensureAlpha [alpha]                    Ensure the output image has an alpha transparency\n                                               channel\n  sharp extend \u003ctop\u003e \u003cbottom\u003e \u003cleft\u003e \u003cright\u003e   Extends/pads the edges of the image with the provided\n                                               background colour\n  sharp extract \u003ctop\u003e \u003cleft\u003e \u003cwidth\u003e \u003cheight\u003e  Extract a region of the image\n  sharp extractChannel \u003cchannel\u003e               Extract a single channel from a multi-channel image\n  sharp flatten [background]                   Merge alpha transparency channel, if any, with a\n                                               background\n  sharp flip                                   Flip the image about the vertical Y axis\n  sharp flop                                   Flop the image about the horizontal X axis\n  sharp gamma [gamma] [gammaOut]               Apply a gamma correction by reducing the encoding\n                                               (darken) pre-resize then increasing the encoding\n                                               (brighten) post-resize\n  sharp greyscale                              Convert to 8-bit greyscale; 256 shades of grey\n                                                                                [aliases: grayscale]\n  sharp joinChannel \u003cimages..\u003e                 Join one or more channels to the image\n  sharp linear [multiplier..]                  Apply the linear formula a × input + b to the image\n                                               to adjust image levels\n  sharp median [size]                          Apply median filter\n  sharp modulate                               Transforms the image using brightness, saturation,\n                                               hue rotation, and lightness\n  sharp negate                                 Produce the \"negative\" of the image\n  sharp normalise                              Enhance output image contrast by stretching its\n                                               luminance to cover the full dynamic range\n                                                                                [aliases: normalize]\n  sharp pipelineColourspace \u003ccolourspace\u003e      Set the pipeline colourspace\n                                                                       [aliases: pipelineColorspace]\n  sharp recomb \u003cmatrix..\u003e                      Recomb the image with the specified matrix\n  sharp removeAlpha                            Remove alpha channel, if any\n  sharp resize [width] [height]                Resize image to width, height, or width × height\n  sharp rotate [angle]                         Rotate the output image\n  sharp sharpen [sigma]                        Sharpen the image\n  sharp threshold [value]                      Any pixel value greather than or equal to the\n                                               threshold value will be set to 255, otherwise it will\n                                               be set to 0\n  sharp tint \u003crgb\u003e                             Tint the image using the provided chroma while\n                                               preserving the image luminance\n  sharp tile [size]                            Use tile-based deep zoom (image pyramid) output\n  sharp toColourspace \u003ccolourspace\u003e            Set the output colourspace    [aliases: toColorspace]\n  sharp trim [threshold]                       Trim pixels from all edges that contain values\n                                               similar to the given background color, which defaults\n                                               to that of the top-left pixel\n  sharp unflatten                              Ensure the image has an alpha channel with all white\n                                               pixel values made fully transparent\n\nGlobal Options\n  -i, --input    Path to (an) image file(s)                      [array] [required] [default: stdin]\n  -o, --output   Directory or URI template to write the image files to\n                                                               [string] [required] [default: stdout]\n      --timeout  Number of seconds after which processing will be stopped                   [number]\n\nInput Options\n      --animated          Read all frames/pages of an animated image                       [boolean]\n      --failOn            Level of sensitivity to invalid images\n                               [choices: \"none\", \"truncated\", \"error\", \"warning\"] [default: warning]\n      --density           DPI for vector images                               [number] [default: 72]\n      --ignoreIcc         Should the embedded ICC profile, if any, be ignored\n                                                                          [boolean] [default: false]\n      --level             Level to extract from a multi-level input (OpenSlide), zero based [number]\n      --limitInputPixels  Do not process input images where the number of pixels (width x height)\n                          exceeds this limit                           [number] [default: 268402689]\n      --page              Page number to start extracting from for multi-page input         [number]\n      --pages             Number of pages to extract for multi-page input      [number] [default: 1]\n      --sequentialRead    Use sequential rather than random access where possible\n                                                                          [boolean] [default: false]\n      --subifd            subIFD to extract for OME-TIFF                      [number] [default: -1]\n      --unlimited         Remove safety features that help prevent memory exhaustion       [boolean]\n\nOutput Options\n  -c, --compressionLevel          zlib compression level                       [number] [default: 6]\n  -f, --format                    Force output to a given format\n      [choices: \"avif\", \"gif\", \"heif\", \"jpeg\", \"jpg\", \"png\", \"raw\", \"tiff\", \"webp\"] [default: input]\n  -m, --metadata, --withMetadata  Include all metadata (EXIF, XMP, IPTC) from the input image in the\n                                  output image                                             [boolean]\n      --metadata.density          Number of pixels per inch (DPI)                           [number]\n      --metadata.exif             Object keyed by IFD0, IFD1 etc. of key/value string pairs to write\n                                  as EXIF data                                         [default: {}]\n      --metadata.icc              Filesystem path to output ICC profile     [string] [default: sRGB]\n      --metadata.orientation      Used to update the EXIF Orientation tag                   [number]\n  -p, --progressive               Use progressive (interlace) scan                         [boolean]\n  -q, --quality                   Quality                                     [number] [default: 80]\n\nOptimization Options\n      --adaptiveFiltering                       Use adaptive row filtering                 [boolean]\n      --alphaQuality                            Quality of alpha layer        [number] [default: 80]\n      --bitdepth                                Reduce bitdepth to 1, 2, or 4 bit\n                                                                  [choices: 1, 2, 4, 8] [default: 8]\n      --chromaSubsampling                       Set to \"4:4:4\" to prevent chroma subsampling when\n                                                quality \u003c= 90\n                                                            [string] [default: 4:4:4 (AVIF) / 4:2:0]\n      --colors, --colours                       Maximum number of palette entries\n                                                                             [number] [default: 256]\n      --compression                             Compression options\n        [choices: \"ccittfax4\", \"deflate\", \"jpeg\", \"jp2k\", \"lzw\", \"none\", \"packbits\", \"webp\", \"zstd\"]\n                                                                                   [default: \"jpeg\"]\n      --delay                                   Delay(s) between animation frames           [number]\n      --dither                                  Level of Floyd-Steinberg error diffusion\n                                                                             [number] [default: 1.0]\n      --effort                                  Level of CPU effort to reduce file size\n                                                                [number] [default: 7 (GIF, PNG) / 4]\n      --hbitdepth                               Set bitdepth to 8, 10, or 12 bit\n                                                                   [choices: 8, 10, 12] [default: 8]\n      --hcompression                            Compression format\n                                                           [choices: \"hevc\", \"av1\"] [default: \"av1\"]\n      --interFrameMaxError                      Maximum inter-frame error for transparency  [number]\n      --interPaletteMaxError                    Maximum inter-palette error for palette reuse\n                                                                                            [number]\n      --loop                                    Number of animation iterations [number] [default: 0]\n      --lossless                                Use lossless compression mode              [boolean]\n      --miniswhite                              Write 1-bit images as miniswhite           [boolean]\n      --minSize                                 Prevent use of animation key frames to minimize file\n                                                size                                       [boolean]\n      --mixed                                   Allow mixture of lossy and lossless animation frames\n                                                                                           [boolean]\n      --mozjpeg                                 Use mozjpeg defaults                       [boolean]\n      --nearLossless                            Use near_lossless compression mode         [boolean]\n      --optimise, --optimize                    Apply optimiseScans, overshootDeringing, and\n                                                trellisQuantisation                        [boolean]\n      --optimiseCoding, --optimizeCoding        Optimise Huffman coding tables\n                                                                           [boolean] [default: true]\n      --optimiseScans, --optimizeScans          Optimise progressive scans                 [boolean]\n      --overshootDeringing                      Apply overshoot deringing                  [boolean]\n      --palette                                 Quantise to a palette-based image with alpha\n                                                transparency support                       [boolean]\n      --predictor                               Compression predictor\n                                    [choices: \"float\", \"horizontal\", \"none\"] [default: \"horizontal\"]\n      --preset                                  Named preset for preprocessing/filtering\n            [choices: \"default\", \"photo\", \"picture\", \"drawing\", \"icon\", \"text\"] [default: \"default\"]\n      --pyramid                                 Write an image pyramid                     [boolean]\n      --quantisationTable, --quantizationTable  Quantization table to use      [number] [default: 0]\n      --reuse, --reoptimise, --reoptimize       Always generate new palettes (slow)        [boolean]\n      --resolutionUnit                          Resolution unit\n                                                             [choices: \"cm\", \"inch\"] [default: inch]\n      --smartSubsample                          High quality chroma subsampling            [boolean]\n      --tileBackground                          Background colour, parsed by the color module\n                                                          [string] [default: rgba(255, 255, 255, 1)]\n      --tileHeight                              Vertical tile size                          [number]\n      --tileWidth                               Horizontal tile size                        [number]\n      --trellisQuantisation                     Apply trellis quantisation                 [boolean]\n      --xres                                    Horizontal resolution        [number] [default: 1.0]\n      --yres                                    Vertical resolution          [number] [default: 1.0]\n\nMisc. Options\n  -h, --help     Show help                                                                 [boolean]\n  -v, --version  Show version number                                                       [boolean]\n\nExamples:\n  sharp -i ./input.jpg -o ./out resize 300 200        out/input.jpg will be a 300 pixels wide and\n                                                      200 pixels high image containing a scaled and\n                                                      cropped version of input.jpg\n  sharp -i ./input.jpg -o ./out -mq90 rotate 180 --   out/input.jpg will be an upside down, 300px\n  resize 300 -- flatten \"#ff6600\" -- composite        wide, alpha channel flattened onto orange\n  ./overlay.png --gravity southeast -- sharpen        background, composited with overlay.png with\n                                                      SE gravity, sharpened, with metadata, 90%\n                                                      quality version of input.jpg\n  sharp -i ./input.jpg -o ./out --metadata            Include all metadata in the output image\n  sharp -i ./input.jpg -o ./out                       Set \"IFD0-Copyright\" in output EXIF metadata\n  --metadata.exif.IFD0.Copyright \"Wernham Hogg\"\n  sharp -i ./input.jpg -o ./out --metadata.density    Set output metadata to 96 DPI\n  96\n\nFor more information on available options, please visit https://sharp.pixelplumbing.com/\n```\n\n## Input and output\n* The CLI supports input streams.\n* [Glob](https://www.npmjs.com/package/glob) patterns are allowed, for example `--input './images/**/*.jpg'`. Make sure you quote the pattern when using the CLI.\n* Supported output macros: `{root}`, `{dir}`, `{base}`, `{name}`, and `{ext}` (from [Node.js path](https://nodejs.org/api/path.html#path_path_parse_path)), for example: `--output {dir}` will overwrite original files.\n\n```\n┌─────────────────────┬────────────┐\n│          dir        │    base    │\n├──────┬              ├──────┬─────┤\n│ root │              │ name │ ext │\n\"  /    home/user/dir / file  .txt \"\n└──────┴──────────────┴──────┴─────┘\n```\n\n## Related\n* [sharp](http://sharp.pixelplumbing.com/) - API for this module\n\n## Changelog\nSee the [Changelog](./CHANGELOG.md) for a list of changes.\n\n## License\n    The MIT License (MIT)\n\n    Copyright (c) 2019 Mark van Seventer\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy of\n    this software and associated documentation files (the \"Software\"), to deal in\n    the Software without restriction, including without limitation the rights to\n    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n    the Software, and to permit persons to whom the Software is furnished to do so,\n    subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvseventer%2Fsharp-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvseventer%2Fsharp-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvseventer%2Fsharp-cli/lists"}