Skip to content

Added the picture test file#41

Open
MariusMarMarius wants to merge 2 commits intomainfrom
Picture-test-for-ADDs
Open

Added the picture test file#41
MariusMarMarius wants to merge 2 commits intomainfrom
Picture-test-for-ADDs

Conversation

@MariusMarMarius
Copy link
Copy Markdown
Collaborator

A new test picture.cpp is implemented.
The test converts a 2D input matrix of pixel values into an ADD. The resulting ADD is then converted back into a new 2D matrix. If the new matrix matches the original input, the ADD Test is completed correctly.

step by step description:

  • A small greyscale picture of a dog represents the input matrix as a set 2D array of pixel values.

  • Depending on its height and width, the matrix is iterated pixel by pixel.

  • In the beginning, dependent on the size of the matrix, a set amount of variables is created.

  • During iteration, these variables are treated as a binary representation of the pixel index.

  • Each 1 (true) or 0 (false) in this binary number sets the corresponding variable. With all variables set, the ADD can be constructed.

  • To create the ADD, a DNF is generated.

  • Each conjunction is an iteration. It consists of the pixel value and every variable.

  • When those conjunctions get connected with disjunctions, the ADD is complete.

  • To reconstruct the matrix, the pixel position for each iteration is known. With that information, the correspondingvariable settings can be restored.

  • To get the pixel value, the ADD gets solved with the belonging variable settings.

A small pixelart-matrix is compressed into an ADD.
This ADD is then decoded and a new matrix is rebuild. Both matrices need to be the identical.
@MariusMarMarius MariusMarMarius linked an issue Nov 12, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

picture test for ADDs

1 participant