{"id":20729281,"url":"https://github.com/yukioru/cwebp-cli","last_synced_at":"2025-04-23T20:18:54.461Z","repository":{"id":57170030,"uuid":"260427484","full_name":"Yukioru/cwebp-cli","owner":"Yukioru","description":"CLI tool, for convert jpg/png files to webp","archived":false,"fork":false,"pushed_at":"2020-05-01T16:26:52.000Z","size":74,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T20:18:32.946Z","etag":null,"topics":["converter","cwebp","encoder","gpr","jpg","nodejs","npx","png","recursive","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/Yukioru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-01T09:59:48.000Z","updated_at":"2025-03-21T14:03:26.000Z","dependencies_parsed_at":"2022-08-27T13:11:55.268Z","dependency_job_id":null,"html_url":"https://github.com/Yukioru/cwebp-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukioru%2Fcwebp-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukioru%2Fcwebp-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukioru%2Fcwebp-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yukioru%2Fcwebp-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yukioru","download_url":"https://codeload.github.com/Yukioru/cwebp-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250506147,"owners_count":21441723,"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":["converter","cwebp","encoder","gpr","jpg","nodejs","npx","png","recursive","webp"],"created_at":"2024-11-17T04:42:02.230Z","updated_at":"2025-04-23T20:18:54.430Z","avatar_url":"https://github.com/Yukioru.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cwebp-cli\n\n![Publish node.js package](https://github.com/Yukioru/cwebp-cli/workflows/Publish%20node.js%20package/badge.svg?branch=master)\n[![NPM verison](https://img.shields.io/npm/v/@yukioru/cwebp-cli)](https://www.npmjs.com/package/@yukioru/cwebp-cli)\n[![GPR verison](https://img.shields.io/github/v/release/yukioru/cwebp-cli?label=gpr)](https://github.com/Yukioru/cwebp-cli/packages/207466)\n![License](https://img.shields.io/github/license/yukioru/cwebp-cli)\n\n## Language: [Russian](https://github.com/Yukioru/cwebp-cli/blob/master/README_RU.md) | English\n\nCLI tool for convert jpg/png files to webp.\n\nBased on [cwebp Encoder](https://developers.google.com/speed/webp/docs/cwebp)\n\n## How to instant use\n```\nnpx @yukioru/cwebp-cli \n```\n\n## How to install\n```\nnpm install -g @yukioru/cwebp-cli\n```\n```\nyarn global add @yukioru/cwebp-cli\n```\n\n## How to use after install\nRun `cwebp` in your console.\n\n## Options\n**-V, --version**\n\u003e Output the version number\n\n**-r, --recursive**\n\u003e Walk given directory recursively\n\n**-f, --files \u003citems\u003e**\n\u003e Files to convert, split by ','\n\n**--lossless**\n\u003e Encode the image without any loss. For images with fully transparent area, the\n\u003e invisible pixel values (R/G/B or Y/U/V) will be preserved only if the -exact\n\u003e option is used\n\n**--near_lossless \u003cint\u003e**\n\u003e Specify the level of near-lossless image preprocessing. This option adjusts\n\u003e pixel values to help compressibility, but has minimal impact on the visual\n\u003e quality. It triggers lossless compression mode automatically. The range is 0\n\u003e (maximum preprocessing) to 100 (no preprocessing, the default). The typical\n\u003e value is around 60. Note that lossy with -q 100 can at times yield better\n\u003e results.\n\n**-q, --quality \u003cfloat\u003e**\n\u003e Specify the compression factor for RGB channels between 0 and 100. The default\n\u003e is 75. In case of lossy compression (default), a small factor produces a\n\u003e smaller file with lower quality. Best quality is achieved by using a value of\n\u003e 100. In case of lossless compression (specified by the -lossless option), a\n\u003e small factor enables faster compression speed, but produces a larger file.\n\u003e Maximum compression is achieved by using a value of 100. (default: 75)\n\n**-z, --zip \u003cfloat\u003e**\n\u003e Switch on lossless compression mode with the specified level between 0 and 9,\n\u003e with level 0 being the fastest, 9 being the slowest. Fast mode produces larger\n\u003e file size than slower ones. A good default is -z 6. This option is actually a\n\u003e shortcut for some predefined settings for quality and method. If options -q or\n\u003e -m are subsequently used, they will invalidate the effect of this option.\n\n**--alpha_q \u003cint\u003e**\n\u003e Specify the compression factor for alpha compression between 0 and 100.\n\u003e Lossless compression of alpha is achieved using a value of 100, while the lower\n\u003e values result in a lossy compression. The default is 100.\n\n**--preset \u003cstring\u003e**\n\u003e Specify a set of pre-defined parameters to suit a particular type of source\n\u003e material. Possible values are: default, photo, picture, drawing, icon, text.\n\u003e Since -preset overwrites the other parameters values (except the -q one), this\n\u003e option should preferably appear first in the order of the arguments.\n\n**-m, --method \u003cint\u003e**\n\u003e Specify the compression method to use. This parameter controls the trade off\n\u003e between encoding speed and the compressed file size and quality. Possible\n\u003e values range from 0 to 6. Default value is 4. When higher values are used, the\n\u003e encoder will spend more time inspecting additional encoding possibilities and\n\u003e decide on the quality gain. Lower value can result in faster processing time at\n\u003e the expense of larger file size and lower compression quality.\n\n**--resize \u003cwidth/height\u003e**\n\u003e Resize the source to a rectangle with size width x height. If either (but not\n\u003e both) of the width or height parameters is 0, the value will be calculated\n\u003e preserving the aspect-ratio.\n\n**--crop \u003cx_position/y_position/width/height\u003e**\n\u003e Crop the source to a rectangle with top-left corner at coordinates (x_position,\n\u003e y_position) and size width x height. This cropping area must be fully contained\n\u003e within the source rectangle.\n\n**-mt, --multithread**\n\u003e Use multi-threading for encoding, if possible.\n\n**--low_memory**\n\u003e Reduce memory usage of lossy encoding by saving four times the compressed size\n\u003e (typically). This will make the encoding slower and the output slightly\n\u003e different in size and distortion. This flag is only effective for methods 3 and\n\u003e up, and is off by default. Note that leaving this flag off will have some side\n\u003e effects on the bitstream: it forces certain bitstream features like number of\n\u003e partitions (forced to 1). Note that a more detailed report of bitstream size is\n\u003e printed by cwebp when using this option.\n\n**--size \u003cint\u003e**\n\u003e Specify a target size (in bytes) to try and reach for the compressed output.\n\u003e The compressor will make several passes of partial encoding in order to get as\n\u003e close as possible to this target. If both -size and -psnr are used, -size value\n\u003e will prevail.\n\n**--psnr \u003cfloat\u003e**\n\u003e Specify a target PSNR (in dB) to try and reach for the compressed output. The\n\u003e compressor will make several passes of partial encoding in order to get as\n\u003e close as possible to this target. If both -size and -psnr are used, -size value\n\u003e will prevail.\n\n**--pass \u003cint\u003e**\n\u003e Set a maximum number of passes to use during the dichotomy used by options\n\u003e -size or -psnr. Maximum value is 10, default is 1. If options -size or -psnr\n\u003e were used, but -pass wasn't specified, a default value of '6' passes will be\n\u003e used.\n\n**-af, --autofilter**\n\u003e Turns auto-filter on. This algorithm will spend additional time optimizing the\n\u003e filtering strength to reach a well-balanced quality.\n\n**--jpeg_like**\n\u003e Change the internal parameter mapping to better match the expected size of JPEG\n\u003e compression. This flag will generally produce an output file of similar size to\n\u003e its JPEG equivalent (for the same -q setting), but with less visual distortion.\n\n**--filter \u003cint\u003e**\n\u003e Specify the strength of the deblocking filter, between 0 (no filtering) and 100\n\u003e (maximum filtering). A value of 0 will turn off any filtering. Higher value\n\u003e will increase the strength of the filtering process applied after decoding the\n\u003e picture. The higher the value the smoother the picture will appear. Typical\n\u003e values are usually in the range of 20 to 50.\n\n**--sharpness \u003cint\u003e**\n\u003e Specify the sharpness of the filtering (if used). Range is 0 (sharpest) to 7\n\u003e (least sharp). Default is 0.\n\n**--strong**\n\u003e Use strong filtering (if filtering is being used thanks to the -f option).\n\u003e Strong filtering is on by default.\n\n**--nostrong**\n\u003e Disable strong filtering (if filtering is being used thanks to the -f option)\n\u003e and use simple filtering instead.\n\n**--sharp_yuv**\n\u003e Use more accurate and sharper RGB-\u003eYUV conversion if needed. Note that this\n\u003e process is slower than the default 'fast' RGB-\u003eYUV conversion.\n\n**--sns \u003cint\u003e**\n\u003e Specify the amplitude of the spatial noise shaping. Spatial noise shaping (or\n\u003e sns for short) refers to a general collection of built-in algorithms used to\n\u003e decide which area of the picture should use relatively less bits, and where\n\u003e else to better transfer these bits. The possible range goes from 0 (algorithm\n\u003e is off) to 100 (the maximal effect). The default value is 50.\n\n**--segments \u003cint\u003e**\n\u003e Change the number of partitions to use during the segmentation of the sns\n\u003e algorithm. Segments should be in range 1 to 4. Default value is 4. This option\n\u003e has no effect for methods 3 and up, unless -low_memory is used.\n\n**--partition_limit \u003cint\u003e**\n\u003e Degrade quality by limiting the number of bits used by some macroblocks. Range\n\u003e is 0 (no degradation, the default) to 100 (full degradation). Useful values are\n\u003e usually around 30-70 for moderately large images. In the VP8 format, the\n\u003e so-called control partition has a limit of 512k and is used to store the\n\u003e following information: whether the macroblock is skipped, which segment it\n\u003e belongs to, whether it is coded as intra 4x4 or intra 16x16 mode, and finally\n\u003e the prediction modes to use for each of the sub-blocks. For a very large image,\n\u003e 512k only leaves room to few bits per 16x16 macroblock. The absolute minimum is\n\u003e 4 bits per macroblock. Skip, segment, and mode information can use up almost\n\u003e all these 4 bits (although the case is unlikely), which is problematic for very\n\u003e large images. The partition_limit factor controls how frequently the most\n\u003e bit-costly mode (intra 4x4) will be used. This is useful in case the 512k limit\n\u003e is reached and the following message is displayed: Error code: 6\n\u003e (PARTITION0_OVERFLOW: Partition #0 is too big to fit 512k). If using\n\u003e -partition_limit is not enough to meet the 512k constraint, one should use less\n\u003e segments in order to save more header bits per macroblock. See the -segments\n\u003e option.\n\n**-v, --verbose**\n\u003e Print extra information (encoding time in particular).\n\n**--print_psnr**\n\u003e Compute and report average PSNR (Peak-Signal-To-Noise ratio).\n\n**--print_ssim**\n\u003e Compute and report average SSIM (structural similarity metric, see\n\u003e http://en.wikipedia.org/wiki/SSIM for additional details).\n\n**--print_lsim**\n\u003e Compute and report local similarity metric (sum of lowest error amongst the\n\u003e collocated pixel neighbors).\n\n**--progress**\n\u003e Report encoding progress in percent.\n\n**--quiet**\n\u003e Do not print anything.\n\n**--short**\n\u003e Only print brief information (output file size and PSNR) for testing purposes.\n\n**--map \u003cint\u003e**\n\u003e Output additional ASCII-map of encoding information. Possible map values range\n\u003e from 1 to 6. This is only meant to help debugging.\n\n**-s, --specify \u003cwidth/height\u003e**\n\u003e Specify that the input file actually consists of raw Y'CbCr samples following\n\u003e the ITU-R BT.601 recommendation, in 4:2:0 linear format. The luma plane has\n\u003e size width x height.\n\n**--pre \u003cint\u003e**\n\u003e Specify some pre-processing steps. Using a value of 2 will trigger\n\u003e quality-dependent pseudo-random dithering during RGBA-\u003eYUVA conversion (lossy\n\u003e compression only).\n\n**--alpha_filter \u003cstring\u003e**\n\u003e Specify the predictive filtering method for the alpha plane. One of none, fast\n\u003e or best, in increasing complexity and slowness order. Default is fast.\n\u003e Internally, alpha filtering is performed using four possible predictions (none,\n\u003e horizontal, vertical, gradient). The best mode will try each mode in turn and\n\u003e pick the one which gives the smaller size. The fast mode will just try to form\n\u003e an a priori guess without testing all modes.\n\n**--alpha_method \u003cint\u003e**\n\u003e Specify the algorithm used for alpha compression: 0 or 1. Algorithm 0 denotes\n\u003e no compression, 1 uses WebP lossless format for compression. The default is 1.\n\n**--exact**\n\u003e Preserve RGB values in transparent area. The default is off, to help\n\u003e compressibility.\n\n**--blend_alpha \u003cint\u003e**\n\u003e This option blends the alpha channel (if present) with the source using the\n\u003e background color specified in hexadecimal as 0xrrggbb. The alpha channel is\n\u003e afterward reset to the opaque value 255.\n\n**--noalpha**\n\u003e Using this option will discard the alpha channel.\n\n**--hint \u003cstring\u003e**\n\u003e Specify the hint about input image type. Possible values are: photo, picture or\n\u003e graph.\n\n**--metadata \u003cstring\u003e**\n\u003e A comma separated list of metadata to copy from the input to the output if\n\u003e present. Valid values: all, none, exif, icc, xmp. The default is none. Note\n\u003e that each input format may not support all combinations.\n\n**--noasm**\n\u003e Disable all assembly optimizations.\n\n**-h, --help**\n\u003e Display help for command\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukioru%2Fcwebp-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyukioru%2Fcwebp-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukioru%2Fcwebp-cli/lists"}