XY Images
XY images are a kind of mathematical art. I discovered them circa 2020.
Software
- xy-png - write an XY image to a PNG file
This program is part of Misk.
Definition
Let ℕ be the set of all nonnegative integers.
For an XY image with width w and height h, in pixels, w, h ∈ ℕ ∖ {0},
let X = {x ∈ ℕ ∣ x < w}, Y = {y ∈ ℕ ∣ y < h}, and P = {x ⋅ y ∣ x ∈ X, y ∈ Y}.
Number the pixels 0, 1, … from top to bottom and left to right.
A pixel is white if its number is in P, otherwise it is black.
Example
For the XY image with width w = 3 and height h = 2, the sets defined above become:
- X = {0, 1, 2}
- Y = {0, 1}
- P = {0 ⋅ 0, 0 ⋅ 1, 1 ⋅ 0, 1 ⋅ 1, 2 ⋅ 0, 2 ⋅ 1} = {0, 1, 2}
The pixels are numbered as follows:
And colored as follows:
White | White | White
|
Black | Black | Black
|
Pixel 0 is white because 0 is in P. Pixel 3 is black because 3 is not in P.
Observations
- The top row of an XY image is white if
- the width and height are equal to 1 or
- the height is greater than 1.
- The bottom row is black if the height is greater than 1.
- Flood-filling the top row reveals shapes that I call stalactites.