Reading raw image files in c#

前端 未结 2 1024
闹比i
闹比i 2021-01-19 22:47

How do i decode/open raw image files like .CR2 or .NEF and .ARW without having the codec installed, something like lightroom open raw files ? My code look like this:

<
相关标签:
2条回答
  • 2021-01-19 23:39

    If you insist on not installing a codec, then your best bet might be these:

    http://www.cybercom.net/~dcoffin/dcraw/
    - written in C, supports most cameras

    http://sourceforge.net/projects/dcrawnet/
    - apparently a (partial?) port of DCRAW to C#, but project does not seem to be active

    0 讨论(0)
  • 2021-01-19 23:40

    If you don't have a codec installed, then you'll have to read the raw image data and convert it to a bitmap or other format that you can read. In order to do that, you need a copy of the format specification so that you can write code that reads the binary data.

    I strongly recommend getting a codec, or finding code that somebody has written that already handles the conversion. But if you really want to try your hand at writing image format conversion code, your first order of business is to get the format specification.

    A quick Google search on [CR2 image format] reveals this Canon CR2 Specification. Truthfully, I don't know how accurate that is, but it looks reasonable. A little time with a search engine will probably reveal similar documents for the other formats.

    Be forewarned: writing these conversions can be a very difficult task. Again, I recommend that you find some existing code that you can leverage.

    0 讨论(0)
提交回复
热议问题