This is console program, in which you can encode and decode messages from png images.
No followers yet
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
I am trying to encode message now, I was successful in that, however I noticed that I am most probably writing into MSB of pixel channel instead of LSB, which creates this kinda cool pattern on resulting image. I always write into red channel when working with RGB and RGBA images, that's why you can see red, cyan and green. They are created when you take out the red from original color under them.
Finally the program is able to successfully open, store and save data from one image into new copy. The issue with filtering was that when you reconstruct data from filtered into raw (decode) you also use raw bytes of data for predictors, same as when filtering from raw (encoding). So when you encode you always read the input stream for raw bytes, but when you decode you have to read from decoded stream to get the raw data for predictors. I was very confused from the png documentation and spent much time on this simple thing. As seen from devlog image the original and copy of image are the same.
I have been able to open the png file, save all data from, decompress and compress it again and write back to the new file. Except the filtering of data. It has to be fixed, because there is some error, which causes image corruption. If I comment out the filtering out and filtering in, in the file, it saves as normal. On the devlog image there is original image (left) and saved image using corrupt filtering function (right).
Now program is also able to filter the decompressed data back into the original data. Also it is bale to compress the data back.
Now I can decompress the data from IDAT chunks. I used zlib library and inflate algorithm. I had to install it and link it, this is where I spent much time, because I did not know that.
Now I am able to display all the contents of all IDAT chunks, I had problem where I was pushing pointer that was changing, into vector, because of that it was not displaying correct data. I created Image class, which takes char pointer and size of it, copies it and only after that pushes it into vector. It solved the issue.