This is my first post here, and I've got a lot to say after reading this thread and experimenting with my camera. (Note that I have a MinGW development environment on my Windows 7 machine.)
[hr]
I have a Fujifilm FinePix S1800 to fiddle with, and I have gained access to the hidden menu using the procedure mentioned in the thread. The YRGB file really isn't raw output, but is simply an uncompressed copy of the JPEG output. The converter located at
http://alexpolter.narod.ru/yrgb2bmp.html (mentioned by apass earlier) requires some source code modification to work with the S1800's output. The changes required are in the following unified diff:
@@ -24,11 +24,15 @@
} FilePropertyT;
FilePropertyT fileTypes[] = {
-{C633, 2848, 2132, 9107904l},
-{C633, 2848, 1896, 8099712l},
-{C633, 2304, 1728, 5971968l},
-{C633, 1600, 1200, 2880000l},
-{C633, 1024, 768, 1179648l},
+{C633, 4000, 3000, 18000000},
+{C633, 4000, 2664, 15984000},
+{C633, 4000, 2248, 13488000},
+{C633, 2816, 2112, 8921088},
+{C633, 2816, 1864, 7873536},
+{C633, 2816, 1584, 6690816},
+{C633, 2048, 1536, 4718592},
+{C633, 2048, 1360, 4177920},
+{C633, 1920, 1080, 3110400},
{C330, 2304, 1728, 8239104l, 2384*2}, /*{C330, 2304, 1728, 8239104l},*/
{0}
};
@@ -117,9 +121,7 @@
"Kodak C633/C330 YRGBxxxx.RAW conversion utility. V1.1 (C) SwD 2007\n"
"Usage: utility [-i] YRGBsrc.RAW output.BMP\n"
"-i interpolate colors\n"
-"Supported modes (recognised by file size):\n"
-"C633: 2848x2132, 2848x1896, 2304x1728, 1600x1200, 1024x768\n"
-"C330: 2304x1728\n"
+"Modified for the Fujifilm FinePix S1800\n"
);
}
Apply the diff to the yrgb2bmp.c file. The modified code builds under MinGW GCC 4.7.2.
The bitmap files resulting from conversion are identical at the pixel level to the JPEG output of the camera. (
see reply #35)
As it turns out, the file size of the YRGB output is (image_width * image_height * 1.5). The lines in the above diff reflect that, implementing all of the S1800's output sizes.
[hr]
The output from the Take12BitCCDRawImage mode (under Debug in the Hidden Menu), however, is more likely to be real raw data. The file format seems to be a very simple data dump of each pixel, with no compression or other processing. Here are some points to note:
- In a hex editor, each pixel is stored as two bytes in little-endian format, since the data looks like "70 00 85 00 32 00 ...". This is surprising because the raw data is supposed to be 12 bits per pixel. However, this characteristic makes decoding the data that much easier because the pattern is readily discernable.
- The size of each raw file is exactly 24,482,400 bytes. Given that each pixel is represented by two bytes, there is a total of 12,241,200 pixels. This is not 4000x3000, but 4040x3030. It is normal for raw image data to represent more pixels than JPEG files, since some of the pixels in the extreme edges of the sensor are cropped out for demosaicing and other processing.
- Raw output files begin with the letters DSCO. For exposures two seconds or longer, the dark frame is stored in a file beginning with the letters DSCB, with the four-digit image number corresponding to the DSCO file.
With this information in mind, it looks fairly easy to write a program to convert the raw data to TIFF, DNG, or other common format. (I mention TIFF because TIFF supports 16 bits per pixel; DNG is probably a bit too complicated to do in a brief project). Of course, further study of the format is needed to fully understand it. Sadly, I'm not skilled enough to write a program to do this. It would be nice to see someone actually write such a program...
--DragonLord