This page contains technical info about the internal operation of the HP4200 Flatbed Scanner.
So to get a correct image color planes must be adjusted. Suppose you want to scan a color photo using 600 dpi as vertical resolution. Once the lm9830 is cofigured to do so at line rate mode, you will get the color info of the image from the scanner buffer in the follogin order: first you will get the data of the red sensor at the position the head scanner is. Then you will get data from the green sensor, but this data matches the info of a line of the photo image 4 lines lower than the line the red sensor has scanned, because the scanner head stays in the same position and is not moved until the data from the tree sensors have been read. So after reading data from the green sensor data from the blue sensor will match color info from the line of the photo image that is 4 lines below the green sensor and 8 lines below the red sensor.
So if you put scanning data into a file after removing the status byte of each line you will get the scanned image in line-interlaced raw format, but due to the offset of the scanner sensors the color planes will be displaced: 4 lines the red plane from the green plane, and 4 lines the green plane from the blue one.
Some factors affect color plane offset:
As the vertical scanning resolution increases color plane offset is larger and vice versa.
If for example, you scan at 600 vdpi sensor distance is 4 lines, but if you discard 1 of 2 lines (i.e. you only get the half number of lines) color plane offset will be divided by 2.
This is obvious but in computer programming all must take into account. Greyscale or B/W scanning uses only one plane, so there isn't any plane offset here.
So what can you do then? The answer is to scan at a higher vertical resolution and discard some lines so only a few lines are really saved on memory and transmitted to the host computer.
For example, suppose you want to scan at a vertical resolution of 600dpi, but the scanner fills the buffer too quickly because you want to scan the maximum line length. Usually moving the scanner head is slower than filling the scanning buffer. So if you say the scanner to scan at a double vertical resolution (1200 dpi) and discard one of each two lines scanned, the scanning process will take twice the time than scanning at 600dpi, because the computed step size is (s)lower. The chip is capable of discard certain number of lines (m) of a bigger number (n) of scanned lines. The discarted lines are not saved in the buffer, but the status byte is.
This functionality can also be used to scan at lower resolutions than 150 dpi when the maximum motor speed is reached. Discarding one of each two lines at 150 vdpi you will get a vertical resolution of 75 dpi.
(under construction...)
Adrian Perez Jorge