This is because I wrote a lossless version of the BMP specification dynamically and into a grayscale format, meaning RGB has to be the same value for all 3 bytes, unless you change the BMP format, or go to a color output. It's not ideal as a way of data storage or compression for this reason, and was more just experimental. :)
Thank you for letting me understand why it becomes 3 times bigger in size. :)
I made other ramifications to this along the way in unreleased versions before I lost the project data from hard drive issues. This was pure binary writing for the BMP bits though, header to EOF... If you are interested, I could probably write a better version of this now anyways. The BMP that was being written by this program though was lossless (no compression), and therefore was really no protection to the data being written to the image, and the data was not by any means obfuscated/encrypted either.
No compression can be applied in this project, I think. The source binary should be compressed or encrypted before converting into the target BMP.
If it doesn't make you too much busy, please rewrite one. :)
If I can remember correctly this was just a plain old 24bit ARGB bitmap output. In hex view it should be obvious that it's by no means efficient though. You should see 4 consecutive bytes for each distinct byte in the file, which hints at the ARGB values for each pixel in reading order for the way the BMP is displayed (right to left).
Thanks for your interest btw, It's a very old project :)
If you rewrote, I wish you would convert each byte of the source binary into each 8bit part of R & G & B values one byte by one byte. This would make the file size almost the same.
FYI,
image - How would I encode a binary file to JPG format - Stack Overflow http://stackoverflow.com/questions/3296045/how-would-i-encode-a-binary-file-to-jpg-format .
PS: May I have any advice how to convert BitCrypt's BMP format into the standard lossy JPG format without losing any quality and recover the JPG into new BMP which can be decrypted into the original source binary without losing any data? It's because some blog service providers allow JPG, PNG, GIF format images only to be uploaded.
Thank you again for your kind explanation!