Crates.io | rating-graph-processor |
lib.rs | rating-graph-processor |
version | 0.2.1 |
source | src |
created_at | 2024-07-07 13:27:22.972782 |
updated_at | 2024-07-07 13:40:17.375836 |
description | Converts the specified image to an image that fits the X (formerly Twitter) header. |
homepage | |
repository | https://github.com/atcoder8/rating-graph-processor |
max_upload_size | |
id | 1294866 |
size | 48,905 |
Converts the specified image to an image that fits the X (formerly Twitter) header1.
The following two images are generated.
The default file names are opaque.png
and header.png
respectively.
The settings can be changed by specifying the configuration file described bellow.
Run the following command to install.
cargo install rating-graph-processor
Specify the original image and the output directory as arguments.
The help message when you run rating-graph-processor -h
is as follows.
Converts the specified image to an image that fits the X (formerly Twitter) header
Usage: rating-graph-processor [OPTIONS] <ORIGINAL_IMAGE> <OUTPUT_DIR>
Arguments:
<ORIGINAL_IMAGE> Original image
<OUTPUT_DIR> Output directory for processed images
Options:
-c, --config <CONFIG> Configuration file
--header-only If this flag is specified, only images processed for headers will be generated. An image that has only been opaque will not be generated
-h, --help Print help
-V, --version Print version
The following settings are available.
Item | Description | Default |
---|---|---|
opaque_image | Filename of the image with opaque processing only. | opaque.png |
header_image | Filename of the processed for the X (formerly Twitter) header. | header.png |
filter | Type of sampling filter to use when resizing the image. | CatmullRom |
You can specify a configuration file using the --config
option.
The configuration file is written in TOML format, and each setting is written in the settings
table.
The following is an example of a configuration file.
[settings]
# Filename of the image with opaque processing only.
# Default: opaque.png
opaque_image = "opaque.png"
# Filename of the processed for the X (formerly Twitter) header.
# Default: header.png
header_image = "header.png"
# Type of sampling filter to use when resizing the image.
# Available filters: [Nearest, Triangle, CatmullRom, GAussian, Lanczos3]
# Default: CatmullRom
filter = "CatmullRom"
The header image size is 1500x500. ↩