(This is going to be long and silly.)
Back in early 90's, when full colour scanners were expensive as hell, My brother and I bought an entry level
tiny flatbed scanner, that could scan as large as a 3R photo and
supposed to be able to do this in 24-bit true colour.
It was supposed to connect to the PC via a RS-232 serial port and was extremely slow. It could also be connected to a bi-directional parallel port. which supposed would make the transfer much faster.
The problem was, the parallel(printer) ports on most PCs BITD were not bi-directional(to print something you send stuff out from your PC, but to scan something you transfer stuff into your PC which most parallel ports couldn't do), so you needed to purchase another ISA card for an extra port and probably a new cable, too. We bought that scanner because it was cheap, so there was no way we would buy another card just for it.
And then, there was
another problem. It's with the software they provided. It only worked on Windows 2.x, but not the then current Windows 3.x. The scanner actually worked as a TWAIN device, so you may just use any graphics programmes that support TWAIN drivers to acquire the scanned images. BUT, for some reasons, that TWAIN drivers only worked when the scanner was connected via a parallel port. When connected through a serial port you're stuck with using that WIN2 software to do the scanning. (It's ironic that, if you buy an expensive model of their scanners, such as a A4 one, it actually no longer provided serial support and instead the parallel port card was bundled with the scanner, since you already paid much and serial port would be too annoyingly slow for transferring a full page of image data over.)
So, we
acquired and installed Windows 286, just for this device and installed the software.
YET another problem appeared. The software had full access to all the options of the scanner and you could set them to whatever you liked, and after scanning the images were saved as EPSON's propriety file format (with extension
.pyx) and you could then convert them to more popular formats like
.bmp and
.pcx. So far so good... until you realised that, the conversion was
not device independent(like many Windows applications advertised), so if the colour depth of your Windows desktop was at 16 colour the resulting image would be in standard Windows 16 colours (actually it was only 8 colours, as the image was in fact saved as 3bpp RGB). And it's understandable that finding drivers of your video card to work on WIN2 was no easy task, but we eventually managed to configure the desktop to display 256 colours, 16-bit high colour and 24-bit true colour. Unfortunately, under 256 colour mode the software saved the same 16(8) colour images, and when using 16-bit onwards, it just crashed with an "Out of memory" error, so the software never worked in the first place.
(Alright alright. This is the coding part.)
We're stuck with the ugly images for quite some time, but by observing the size of the original
.pyx files I was certain that the images were indeed saved in full colour. Thus I started doing test scans (like say scanning a completely red image, and in varying dimensions etc.) and observed the files with a hex editor. I eventually figured out what most of the entries in the file header meant, that the file contained a 3bpp preview image (which was actually what you got when you saved the images as another formats) followed by the raw scanned data, and I figured out the order of the RGB channels too, i.e. I basically reverse engineered the format.
I then told my brother to give me two weeks and I probably could do something with it. Eventually I mucked up in an afternoon a command line converter that took a 24-bit pyx file and converted it into a 24-bit bmp file, using my limited knowledge in c++ and compiled it in Turbo C++. From that day after jumping through numerous hoops, we could enjoy scanned images in full colours!
I found this quite an achievement, until the FUTURE arrived, that nowadays you can get easily connected scanners with much higher quality for cheap, and in many more cases you can just use your smart phone to shoot high resolution digital photos instead of scanning in printed photos (my brother actually assembled a small light box for the scanner to scan films...).