Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sharp-cli

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharp-cli

CLI for sharp.

  • 0.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.2K
increased by1.09%
Maintainers
1
Weekly downloads
 
Created
Source

sharp-cli

CLI for sharp.

Issues with the output should be reported on the sharp issue tracker.

Install

$ npm install sharp-cli

Usage

$ sharp --help
  CLI for sharp.

  Usage
    $ sharp [options] [files...]
    $ cat <file> | sharp [options] > <output>

  Examples
    $ sharp --quality 50 -o dest.jpg src.jpg
    $ sharp --width 250 -o dest/ src/*
    $ sharp --grayscale src.jpg > dest.jpg
    $ cat src.jpg | sharp --rotate 90 > dest.jpg

  Options
    --background                 Set the background color for --embed and --flatten operations.
    --bandbool <string>          Perform a bitwise boolean operation on all input image channels to
                                 produce a single channel output image.
    --blur [number]              Blur the output image, optionally specifying the blur radius.
    --compressionLevel <number>  zlib compression level, between 0 and 9, of the lossless PNG output
                                 format. Defaults to 6.
    --crop <string>              Crop the resized image based on the specified gravity (north, east,
                                 south, west, center).
    --embed                      Resize the image, then embed on a background.
    --extendTop <number>         Pixels to add to the top edge. Use in conjunction with --extendLeft,
                                 --extendBottom, and --extendRight.
    --extendLeft <number>        Pixels to add to the left edge. Use in conjunction with --extendTop,
                                 --extendBottom, and --extendRight.
    --extendBottom <number>      Pixels to add to the bottom edge. Use in conjunction with
                                 --extendTop, --extendLeft, and --extendRight.
    --extendRight <number>       Pixels to add to the right edge. Use in conjunction with --extendTop,
                                 --extendLeft, and --extendBottom.
    --extractChannel <string>    Extract a single channel from a multi-channel image.
    --extractHeight <number>     Height of the region to be extracted. Use in conjunction with
                                 --extractLeft, --extractTop, and --extractWidth.
    --extractLeft <number>       Left offset of the region to be extracted. Use in conjunction with
                                 --extractHeight, --extractTop, and --extractWidth.
    --extractTop <number>        Top offset of the region to be extracted. Use in conjunction with
                                 --extractHeight, --extractLeft, and --extractWidth.
    --extractWidth <number>      Width of the region to be extracted. Use in conjunction with
                                 --extractHeight, --extractLeft, and --extractTop.
    -f, --format <string>        Output format (jpeg, png, webp, raw). Defaults to input format.
    --flatten                    Merge alpha transparency channel, if any, with --background.
    --flip                       Flip the image about the vertical Y axis.
    --flop                       Flip the image about the horizontal X axis.
    --gamma [number]             Apply a gamma correction, optionally specifying a factor between 1
                                 and 3. Defaults to 2.2.
    --grayscale, --greyscale     Convert to grayscale.
    -h, --height <number>        Scale output to height.
    --help                       Output usage information.
    --kernel <string>            Kernel to use for image reduction (cubic, lanczo2, lanczo3). Defaults
                                 to lanczo3. Use in conjunction with --width or --height.
    --ignoreAspectRatio          Stretch the image to the exact width and/or height specified.
    --interpolator <string>      Use the specified interpolator (nearest, bilinear, bicubic,
                                 vertexSplitQuadraticBasisSpline (vsqbs), locallyBoundedBicubic (lbb),
                                 nohalo) for image resizing. Use in conjunction with --width or
                                --height.
    --limitInputPixels <number>  Do not process input images where the number of pixels
                                 (width × height) exceeds the specified amount.
    --max                        Resize the image to be as large as possible while ensuring its
                                 dimensions are less than or equal to the specified width and height.
    --min                        Resize the image to be as small as possible while ensuring its
                                 dimensions are greater than or equal to the specified width and
                                 height.
    --negate                     Produces the negative of the image.
    --normalize, --normalise     Enhance output image contrast.
    -o, --output <string>        The output filename, or directory when performing batch operations.
    --optimizeScans, --optimiseScans
                                 Calculate which spectrum of DCT coefficients uses the fewest bits.
                                 Used for progressive (interlace) JPEG output.
    --overlay <string>           Alpha composite the specified file over the processed image.
    --overlayCutout              Apply only the alpha channel of the overlay to the image to be
                                 overlaid. Use in conjunction with --overlay.
    --overlayGravity <string>    Place the overlay based on the specified gravity (north, east, south,
                                 west, center). Use in conjunction with --overlay.
    --overlayTile                Repeat the overlay image across the entire image. Use in conjunction
                                 with --overlay.
    --overlayLeft <number>       The number representing the pixel offset from the left edge. Use in
                                 conjunction with --overlay.
    --overlayTop <number>        The number representing the pixel offset from the top edge. Use in
                                 conjunction with --overlay.
    --overshootDeringing         Reduce the effects of ringing in JPEG output.
    --progressive                Use progressive (interlace) scan for JPEG and PNG output.
    -q, --quality <number>       The output quality, between 1 and 100, to use for lossy JPEG, WebP,
                                 and TIFF output formats. Defaults to 80.
    --rotate [number]            Rotate the output image by the specified angle (0, 90, 180, 270), or
                                 auto-orient based on the EXIF Orientation tag.
    --sequentialRead             Switches the libvips access method to VIPS_ACCESS_SEQUENTIAL.
    --sharpen <number>           Sharpen the output image, optionally specifying the sharpen sigma.
    --sharpenFlat <number>       Specify the level of sharpeness to apply to "flat" areas. Defaults to
                                 1.0. Use in conjunction with --sharpen.
    --sharpenJagged <number>     Specify the level of sharpeness to apply to "jagged" areas. Defaults
                                 to 2.0. Use in conjunction with --sharpen.
    --threshold <number>         Specify the level above which pixels will be forced to white.
    --tile [number]              Applies square image pyramid tiles over the image, optionally
                                 specifying a tile size between 1 and 8192. Defaults to 256 pixels.
    --tileContainer <string>     Specifies the tile container (fs, zip). Defaults to fs.
    --tileLayout <string>        Specifies the layout to use when generating square Deep Zoom image
                                 pyramid tyles (dz, zoomify, google). Defaults to dz.
                                 Use in conjunction with --tile.
    --tileOverlap <number>       Specifies the tile overlap, between 0 and 8192. Defaults to 0 pixels.
                                 Use in conjunction with --tile.
    --trellisQuantization, --trellesQuantisation
                                 Apply the use of trellis quantization with JPEG output.
    --trim <number>              Trims "boring" pixels from all edges that contain values within a
                                 percentage similarity of the top-left pixel.
    -v, --verbose                Output image processing information.
    -w, --width <number>         Scale output to width.
    --withoutAdaptiveFiltering   Disable adaptive row filtering for the lossless PNG output format.
    --withoutChromaSubsampling   Disable the use of chroma subsampling with JPEG output (4:4:4).
    --withoutEnlargement         Do not enlarge the output image if the input image width or height
                                 are already less than the required dimensions.
    --withoutMetadata            Exclude any metadata (EXIF, XMP, IPTC) from the output image.

In-depth documentation regarding the available options is available on the Sharp website.

Changelog

See the Changelog for a list of changes.

License

The MIT License (MIT)

Copyright (c) 2016 Mark van Seventer

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 17 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc