From b8f49c293215707650a7f3b1d69403b359059c4a Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Mon, 10 Jun 2019 17:50:43 -0400 Subject: Added "How it works" section to README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 00a1235..bafd6d5 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,20 @@ To run AutoDistortion on an image, download one of the [releases](https://github Only PNG and JPG images are supported so far. +## How it works + +AutoDistortion works by randomly generating two functions, X(x, y) and Y(x, y), for example: + +``` +X(x, y) = 2x + 3y +Y(x, y) = sin(7y) +``` + +Then, the color of the pixel at (x, y) in the output image will be the color of the pixel at (X(x, y) modulo width, Y(x, y) modulo height) in the input image (where width and height are the dimensions of the input image). + +To make sure that images at different resolutions are treated the same, AutoDistortion divides x and y by the width and height of the image respectively before doing this. + + ## Building AutoDistortion from source To build AutoDistortion, simply run -- cgit v1.2.3