Skip to content

Commit 294af88

Browse files
committed
new: announce encoder changes
docs
1 parent f334bee commit 294af88

File tree

2 files changed

+218
-42
lines changed

2 files changed

+218
-42
lines changed

README.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77

88
Refract is a cross-platform[\*](#installation) guided image conversion tool.
99

10-
It takes [JPEG](https://en.wikipedia.org/wiki/JPEG) and [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) image sources and produces [AVIF](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)), [JPEG XL](https://en.wikipedia.org/wiki/JPEG_XL), and [WebP](https://en.wikipedia.org/wiki/WebP) clones.
10+
It takes [JPEG](https://en.wikipedia.org/wiki/JPEG) and [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) image sources and produces [AVIF](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)), [JPEG XL](https://en.wikipedia.org/wiki/JPEG_XL), and [WebP](https://en.wikipedia.org/wiki/WebP) copies.
1111

1212
<img src="https://github.com/Blobfolio/refract/raw/master/skel/gallery/screen0.png" width="45%" alt="Viewing a PNG source."></img> <img src="https://github.com/Blobfolio/refract/raw/master/skel/gallery/screen1.png" width="45%" alt="Viewing a (crappy) WebP copy."></img>
1313

14-
The program works something like an optometrist's refraction test, presenting a series of feedback-driven candidate images — what looks better, this… or this? This… or this? — until the subjective "best" option is found (or found to be impossible).
14+
The program is named for and works something like an optometrist's refraction test, presenting a series of feedback-driven candidate images — what looks better, this… or this? This… or this? — until the subjective "best" option is found (or found to be impossible).
1515

1616
Hence "guided".
1717

1818
The beauty of this sort of approach is it moots the need for exhaustive testing.
1919

20-
Every yay and nay you provide effectively halve the number of possibilities remaining to be tested. The ideal copy, whatever and wherever that might be, can be found in a handful of steps instead of a hundred.
20+
Every Yay and Nay you provide halve the number of possibilities remaining to be tested. The ideal copy, whatever and wherever it might be, can be found in a handful of steps instead of a hundred.
2121

2222

2323

2424
## Why?
2525

2626
Every image is different.
2727

28-
There is no such thing as a one-size-fits-all quality setting.
28+
There is no such thing as a one-size-fits-all quality setting, or even a one-size-fits-all image format.
2929

3030
Whether you're looking for perfect copies or merely passable ones, the only way to be sure you're not producing over- or under-compressed images is to _use your eyes_.
3131

@@ -53,19 +53,36 @@ Refract implements [`libavif`](https://github.com/AOMediaCodec/libavif), [`libjx
5353

5454
All conversion takes place at Pixel Level and is intended for displays with an sRGB color space (e.g. web browsers). Gamma correction, color profiles, and other metadata are ignored and stripped out when saving next-gen copies.
5555

56-
File sizes are taken into account as well; refract will only suggest/save conversions that wind up smaller than the sources. (Otherwise what's the point?)
56+
All conversions are performed using the maximum/slowest (general) encoder settings, ensuring the smallest possible output. Refract also explicitly tracks the input and output file sizes to save you having to review counter-productive combinations.
5757

5858

5959

6060
## Usage
6161

6262
Refract is pretty straightforward:
6363

64-
1. Choose the output formats (and other settings);
64+
0. Open the program;
65+
1. Choose the output format(s) and tweak any other settings you want;
6566
2. Choose one or more JPEG/PNG source files to crunch;
6667
3. Sit back and wait for the feedback prompts;
6768

68-
For best results, be sure to optimize your input sources _before_ re-encoding them with refract. (The CLI tool [flaca](https://github.com/Blobfolio/flaca) is great for this, and fully automatic.)
69+
### Feedback
70+
71+
Lossless conversions require no human supervision. Being lossless, all that really matters is that shit gets smaller, and refract can figure _that_ out on its own. ;)
72+
73+
Lossy conversions are another matter since, by their very nature, information is lost in translation.
74+
75+
For those, refract will present a series of "candidate" images to you, one at a time, in a simple A/B fashion for easy comparison with the original sources.
76+
77+
The "feedback" comes in the form of two buttons — "reject" and "accept" — which can be thought of as answers to the question: Are you happy with this copy?
78+
79+
If it looks like what you want it to, great!, accept it. If not, reject it. Refract will raise or lower the quality of the next candidate accordingly.
80+
81+
Rinse and repeat.
82+
83+
The smallest of the accepted candidates, if any, will be saved to disk at the end of the process, the rest forgotten like a passing dream.
84+
85+
Then it's back around again for the next input/output pair!
6986

7087

7188

@@ -97,29 +114,31 @@ refract [FLAGS] [OPTIONS] <PATH(S)>...
97114

98115
## Installation
99116

100-
Debian and Ubuntu users with x86-64 CPUs can just grab the pre-built `.deb` package from the [release page](https://github.com/Blobfolio/refract/releases/latest), and Arch Linux users can pull it from [AUR](https://aur.archlinux.org/packages/refract-bin) (community-maintained).
117+
Pre-built packages for x86-64 CPU architectures are available for Debian and Ubuntu users on the [release page](https://github.com/Blobfolio/refract/releases/latest), and to Arch Linux users via [AUR](https://aur.archlinux.org/packages/refract-bin).
101118

102-
To use refract in other environments, it needs to be built from source.
119+
To use refract in other environments, it'll needs to be built from source.
103120

104121
Thankfully, [Rust](https://www.rust-lang.org/)/[Cargo](https://github.com/rust-lang/cargo) make this pretty easy:
105122

106123
```bash
107-
# Install the build dependencies. Ubuntu and debian users, for example,
124+
# Install the build dependencies. Ubuntu and Debian users, for example,
108125
# can run:
109126
sudo apt-get install -y cmake g++ gcc git make nasm ninja-build
110127

111-
# See "cargo install --help" for more options.
128+
# Build and install refract:
112129
cargo install \
113130
--git https://github.com/Blobfolio/refract.git \
114131
--bin refract
115132
```
116133

117134
### Build Dependencies
118135

119-
The extra build dependencies (required by all the damn image codecs) will vary by environment, but at a minimum you'll need C and C++ compilers, `cmake`, `git` (obviously), `make`, `nasm`, and `ninja-build`.
136+
The extra build dependencies (required by all the damn image codecs) will vary by environment, but at a minimum you'll need up-to-date C and C++ compilers, `cmake`, `git` (obviously), `make`, `nasm`, and `ninja-build`.
120137

121138
Cargo should pop an error if anything's missing. If that happens, just find/install the missing dep and give `cargo install` another shot.
122139

140+
If you wind up needing something not on this list, please [open an issue](https://github.com/Blobfolio/refract/issues) so it can be given a mention. ;)
141+
123142
### Runtime Dependencies
124143

125144
On Linux, the file dialogues require one of `xdg-desktop-portal-[gnome, gtk, kde]` or `zenity`, user's choice.

0 commit comments

Comments
 (0)