Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify README file #125

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cargo install rimage

## Usage

```
```text
Usage: rimage [OPTIONS] <FILES>...

Arguments:
Expand All @@ -42,28 +42,35 @@ Options:
-V, --version Print version

General:
-q, --quality <QUALITY> Optimization quality [default: 75]
-f, --codec <CODEC> Image codec to use [default: mozjpeg]
-o, --output <DIR> Write output file(s) to <DIR>
-r, --recursive Saves output file(s) preserving folder structure
-s, --suffix [<SUFFIX>] Appends suffix to output file(s) names
-b, --backup Appends '.backup' to input file(s) names
-q, --quality <QUALITY> Optimization quality
[default: 75, Range: 1-100]
Mikachu2333 marked this conversation as resolved.
Show resolved Hide resolved
-f, --codec <CODEC> Image codec to use
[default: mozjpeg]
Mikachu2333 marked this conversation as resolved.
Show resolved Hide resolved
-o, --output <DIR> Write output file(s) to <DIR>
-r, --recursive Saves output file(s) preserving folder structure
-s, --suffix [<SUFFIX>] Appends suffix to output file(s) names
-b, --backup Appends ".backup" to input file(s) names

Quantization:
--quantization [<QUALITY>] Enables quantization with optional quality [default: 75]
--dithering [<QUALITY>] Enables dithering with optional quality [default: 75]
--quantization [<QUALITY>] Enables quantization with optional quality
[default: 75, Range: 1-100]
--dithering [<QUALITY>] Enables dithering with optional quality
[default: 75, Range: 1-100]

Resizing:
--width <WIDTH> Resize image with specified width
--height <HEIGHT> Resize image with specified height
--filter <FILTER> Filter used for image resizing [default: lanczos3]
--width <WIDTH> Resize image with specified width
[Integer only]
Mikachu2333 marked this conversation as resolved.
Show resolved Hide resolved
--height <HEIGHT> Resize image with specified height
[Integer only]
--filter <FILTER> Filter used for image resizing
[default: lanczos3]
```

Note that image formats may wary from features that are used when building `rimage`.

List of supported codecs with all features:

- `mozjpeg`, `jpeg`, `jpg` => mozjpeg codec
- `mozjpeg`, `jpeg`, `jpg` => **mozjpeg codec (common and small)**
- `png` => browser png codec without compression
- `oxipng` => oxipng codec with compression
- `jpegxl`, `jxl` => jpeg xl codec
Expand All @@ -78,6 +85,16 @@ List of available resize filters:
- `mitchell` => Resize using Mitchell-Netravali filter
- `lanczos3` => Resize using Sinc-windowed Sinc with radius of 3

## Example
Mikachu2333 marked this conversation as resolved.
Show resolved Hide resolved

|Image|Quality|Format|Dir|Backup|
|----|----|----|----|----|
|"D:\\Desktop\\input [text].png"|90|jpg|"D:\\Desktop\\OutputTest"|True|

```sh
rimage.exe "D:\\Desktop\\input [text].png" -q 90 --codec jpg -o "D:\\Desktop\\OutputTest" -b
```

## Library Installation

Add Rimage to your project with Cargo:
Expand Down