Author Topic: Add additional raw renderers  (Read 2511 times)

Offline benjamin.blix

  • Newcomer
  • *
  • Posts: 9
    • View Profile
Add additional raw renderers
« on: September 05, 2023, 03:16:29 PM »
I'd love to see support for other raw rendering engines under the Enable RAW Rendering checkbox; in particular FastRawViewer support would be great.

I tried out adding the FastRawViewer app as a DNG Converter, but naturally PMP notices that this is not the Adobe DNG Converter it expects.

I'm not sure what FastRawViewer is doing that makes it fast, but if there is some special sauce that PMP can take advantage of that would be sweet (of course this would require the user to purchase their own FRV license, but currently that's relatively inexpensive).

Related to: https://forums.camerabits.com/index.php?topic=15191.0 (Topic: Why it is not possible to select the built-in raw renderer on Apple Mac Air M2?)

A few additional ideas:
  • remove the checkbox for built-in renderer until it is available
  • add a textbox for specifying custom command line options for raw renderers that aren't officially supported
  • update the PM preview to support issuing batches of images to the renderer (I think PM has some logic to determine what photo the user is likely to view next so they can be pre-rendered, and this could be used to produce multiple results to be issued as a single raw render invocation)
  • add an option to display the raw file histogram when using jpeg in preview
« Last Edit: September 16, 2023, 04:55:04 PM by benjamin.blix »

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24977
    • View Profile
    • Camera Bits, Inc.
Re: Add additional raw renderers
« Reply #1 on: September 05, 2023, 03:49:03 PM »
I'd love to see support for other raw rendering engines under the Enable RAW Rendering checkbox; in particular FastRawViewer support would be great.

I tried out adding the FastRawViewer app as a DNG Converter, but naturally PMP notices that this is not the Adobe DNG Converter it expects.

Does FastRawViewer offer a command-line application that can render a RAW file as a JPEG instead of a DNG?  That would be much better than rendering to a DNG and extracting its embedded JPEG preview.

-Kirk

Offline benjamin.blix

  • Newcomer
  • *
  • Posts: 9
    • View Profile
Re: Add additional raw renderers
« Reply #2 on: September 16, 2023, 04:53:57 PM »
Thanks for the fast reply!

I haven't been able to run FastRawViewer on the command line, but after some digging and some trial and error, I've found something that might work. I think FRV is using LibRaw, which does have some associated command line tools, and which itself is a fork of the dcraw CLI tool.

Using the precompiled LibRaw binaries for macos (from https://www.libraw.org/download), and piping the output to the `convert` tool from ImageMagick, I can get a not-unbearably-slow jpeg render:
Code: [Select]
./dcraw_emu -h -T -Z - /path/to/file.NEF | convert - /path/to/file.jpg

For the dcraw_emu arguments, h provides a half-size file and seems to be their fastest render mode; T produces TIFF output; "Z -" redirects the output so I can pipe it to `convert`.

The NEF render handled by dcraw_emu takes about 600ms on my mac (which sounds kinda slow to me, but maybe this is normal for RAW file rendering)

LibRaw download: https://www.libraw.org/download
LibRaw usage notes: https://www.libraw.org/docs/Samples-LibRaw.html
dcraw: https://www.dechifro.org/dcraw/

Additionally, it looks like dcraw could be a viable alternative to FRV/libraw for our purposes. It seems to be a single c file that is supposedly able to be compiled on a variety of systems, but if PMP gets the option to invoke arbitrary raw render binaries, that could be left as an exercise for the user ;D

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24977
    • View Profile
    • Camera Bits, Inc.
Re: Add additional raw renderers
« Reply #3 on: September 17, 2023, 03:31:45 PM »
LibRaw doesn't do proper color rendering.  Some cameras look OK, some look horrendous.

We've investigated it and while LibRaw provides a solid foundation for decoding RAW images, it requires a lot of development effort to produce quality images.

-Kirk

Offline benjamin.blix

  • Newcomer
  • *
  • Posts: 9
    • View Profile
Re: Add additional raw renderers
« Reply #4 on: September 17, 2023, 11:13:43 PM »
Aha good to know!

Is there still a possibility of adding an option to invoke arbitrary command line tools as raw renderers, maybe with a file path available as a variable in the command?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24977
    • View Profile
    • Camera Bits, Inc.
Re: Add additional raw renderers
« Reply #5 on: September 18, 2023, 08:55:27 AM »
Aha good to know!

Is there still a possibility of adding an option to invoke arbitrary command line tools as raw renderers, maybe with a file path available as a variable in the command?

I don't see why not, that's pretty much what we're doing with the Adobe DNG Converter.

-Kirk