Upscaling images for fun and profit - without any math calculating any new color values.
First ensure, rustup
is installed. If not, got to https://rustup.rs/ and follow the instructions.
For Unix environments, install rustup
by running -
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then, after restarting shell, run -
cargo install --git https://github.com/DhruvDh/upscaler
See via upscaler --help
Upscaler 0.1.0
Dhruv D. <[email protected]>
Upscales images
USAGE:
upscaler [OPTIONS] <INPUT> <OUTPUT>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-s, --scale <scale> Scaling factor [default: 2] [possible values: 2, 4, 8, 16, 32]
ARGS:
<INPUT> The input image to upscale [possible types: hdr, bmp tga, tiff, dxt, gif, jpeg, png, pnm, webp]
<OUTPUT> The output image to write [possible types: jpeg, png]
The heuristic used for upscaling works particularly well for gradients, I think.
Input (256 by 256) | 2x upscale (512 by 512) | 4x upscale (1024 by 1024) |
---|---|---|
Random images from https://picsum.photos/
Input (256 by 256) | 2x upscale (512 by 512) | 4x upscale (1024 by 1024) |
---|---|---|
Input (512 by 512) | 2x upscale (1024 by 1024) | 4x upscale (2048 by 2048) |
---|---|---|
Note that all algorithms produce visually better results when input images are larger.