On Thu, 12 Jun 2003, [iso-8859-1] Thomas VIAL wrote: > Hi, > > > > What I meant by "whitespace" is the blank spots > > between bytes in a file. > > For example, > > > > bc 3f > > > > and what is between the c and the 3 I am calling > > "whitespace." > > Er, "bc" and "3f" are just two distinct bytes in > hexadecimal, 188 and 63 respectively.
Yes. I know that. > It seems you are > interpreting the hex dump as raw data... > One byte is 2 hex digit, and the whitespace is here > for readability. > Again, yes. My point was that a string of bytes equal in number to the number of pixels in the picture will give precisely no good result, but that on the other hand putting the text fomat of same data, obtained by suitable editing of the log file, will give a picture provided one only puts a ppm header on the top. In other words, if you read (for example) bc as one byte, and not as three bytes (one for b, one for c, and one for the space after it, and so on through the rest of the file) you do get a file but it is not a picture, but if you do it the second way (stupid as that may look) you do get a picture. > Once correctly interpreted as a sequence of hex bytes, > my guess is that the log data is strictly equivalent > to the raw data, since the final number of bytes is > the same. > No it isn't. The "final number of bytes" in the text file is equal to the number of bytes dumped, times exactly three. And it is the text file with appropriate header which gives a picture. > With a correct bmp header the raw data should be ok > (maybe upside down). Well, actually, it is more complicated. The ppm format only turns the picture upside down, but leaves the colors approximately correct. The bmp format gives you the picture right-side up, mirror-imaged left to right, and seems to reverse red and blue or red and green. > But with 1 byte per pixel the image should be > interpreted as greyscale I think This is not what happens. I judge by the results. > -- unless it uses a > palette? Well, I did not introduce any palette. So if it is using one it is built-in in ImageMagick, GIMP, and in the Windows software, all three. I just dumped the log data into a file, stuck a header on it, and viewed it. Looking at things positively, I did get the data out of the camera by hook or by crook, and nobody told me how to do it. This is fun, isn't it? After all, I am only doing this because the problem is there to solve, and the camera seemed simple enough for a beginner in device support like me, that I could fool with it and learn something. after all, unlike a scanner it has no moving parts. Ted Kilgore
