Skip to content

Commit

Permalink
Explain steps and power in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Feb 8, 2024
1 parent 8afea7f commit 45a6aef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [MacOS complains that program from unidentified developer](#macos-complains-that-program-from-unidentified-developer)
- [I want to upload stickers that are in stickers_output that have not been uploaded yet](#i-want-to-upload-stickers-that-are-in-stickers_output-that-have-not-been-uploaded-yet)
- [Where are credentials stored?](#where-are-credentials-stored)
- [What does "power" and "steps" mean?](#what-does-power-and-steps-mean)
- [Future plans](#future-plans)
- [Credits](#credits)
- [DISCLAIMER](#disclaimer)
Expand Down Expand Up @@ -397,6 +398,16 @@ However, if the directory is not writable (e.g. Installed it to `/Applications`
- Windows: `%APPDATA%/sticker-convert/creds.json`
- Other: `~/.config/sticker-convert/creds.json`

### What does "power" and "steps" mean?
It's actually a bisection method to look for most optimal compression setting. The `power` provides a way to make the values 'deviate' to one side (Negative power would cause sticker-convert to try more large values; Power set to 1 would cause sticker-convert to distribute it's trial evenly between the min and max values; Power more than 1 would cause sticker-convert to try more small values)

To illustrate, let's look at what `--steps 16 --fps-min 5 --fps-max 30 --fps-power 3.0` does.
1. We would start from `8/16` (step 8 out of 16 steps), which is the mid-point.
2. We would calculate a factor using power: `(8/16)^3.0 = 0.125`
3. The fps setting is `round((max - min) * step / steps * factor + min)`, which is `round((16-1) * 8 / 16 * 0.125 + 5) = round(5.9375) = 6`. This means fps would be set to 6.
4. If the file size is too small, then we would try `4/16` (step 4 out of 16 steps, which is midpoint of 0 to 8.). Else, we would try `10/16` (step 10 out of 16 steps, which is midpoint of 8 to 16).
5. Repeat 1-3.

## Future plans
See [docs/TODO.md](docs/TODO.md)

Expand Down

0 comments on commit 45a6aef

Please sign in to comment.