# img2yuv
This is a library for converting image data to YUV 420 planar, which is a useful
step when preparing images for H.264 or H.265 encoding.
## Testing
To run tests, simply run `cargo test`.
### Snapshot tests
Some tests use [insta](https://insta.rs/) for snapshot testing. If you are doing
development, follow instructions on that page for installing the `cargo-insta`
CLI. When a test's snapshot output changes, you can then use `cargo insta
review` to review those changes, and decide whether to accept them as the new
baseline for future test runs.
### Test image data
All of the test image data is generated by a python script under `testdata/gen`.
Each image is an encoding of the same set of vertical color bars. Tests use
these to validate that the decoded image matches expectation (with some degree
of fuzziness for lossy compression).
To regenerate test data, run the following command in that directory:
```bash
uv run main.py
```