rawproc 0.9 Is Released, and rawproc2 is Contemplated...

hmm, that makes sense, but I only seem to have the option for input.raw.libraw.cameradata and no other keys with input.raw.libraw in properties.

You can add it with the Add button. It’s sounds like 0.9 is using your old rawproc.conf, wherever it is…

So you don’t mess up your old setup, I’d recommend you make a new rawproc.conf (you can copy the old one), then set it up for no-dcraw processing:

input.raw.libraw.rawdata=crop input.raw.default=group:colorspace:camera,assign;subtract:camera;whitebalance:camera;demosaic:half blackwhitepoint:rgb,data

ah, good catch! I hadn’t deleted rawproc.conf when I uninstalled 0.6.2. I just took a copy from the 0.9 zip and it’s looking much better.

It’s now only a bit off for color (cyan cast), but I still can’t seem to get colorspace to work. If I enter the camera primaries in the colorspace profile file field, it doesn’t seem to do anything. I also tried adding input.raw.colorspace with the camera primaries, but that didn’t work either.

Tell you what, let’s try to build the toolchain by-hand, and not rely on default processing. That way, you can see at each step what it takes to get to a linear RGB.

  1. Make sure display.cms=1 and display.cms.displayprofile has a valid profile. If you have a calibrated display profile that’s best, but if not a sRGB profile will suffice. I use Elle’s well-behaved profile set, and her sRGB-elle-V4-g22.icc is what I use when I don’t have a display profile. You can get ready-to-use files here:
  1. Make sure rawproc will not apply dcraw processing by setting input.raw.libraw.rawdata=1, or =crop.

  2. Open the raw file with File → Open. When the prompt to apply input.raw.default processing comes up, say No. You’ll end up with the out-of-the-file raw image on the screen, dark and monchrome. Also, you’ll see ‘CMS’ in the status line because there’s no input profile available to do the transform. We’ll fix that in the next step…

  3. Add a colorspace tool. This is where we’ll assign a camera profile to the image, which will get CMS to do a proper display transform. Since the raw file didn’t contain a color profile, you’ll get a warning about “only ‘assign’ is valid”, and this is important thing to know, any color transform requires both an input and output profile. So, we’ll try “assign camera profile” first, select that with the radio button. The camera make/model should already be displayed; when you click the radio button the tool will go looking for the primaries. If it comes up blank, select the ‘profile file:’ radio button, make sure the ‘assign’ operator is selected, paste those primaries I gave you in the previous post and hit the Enter key. If all is good, you should see a somewhat lighter but still monochrome image and CMS:display in the status bar.

  4. Add a subtract tool. If the raw file contained a value, it’ll be displayed in the ‘camera’ operator, and you should select that. If not, then type 512 in the value box and select ‘value’.

  5. Add a whitebalance tool. There should be three numbers beside the ‘camera’ operator, those would come from the raw file metadata. If not, this’ll be a bit tricky, as you’ll have to find those numbers yourself. More on that in a bit.

  6. Add a demosaic tool. Right now, ‘half’ will suffice. At this point, you should have a decent RGB rendition of the image, but still dark and/or flat. This is a linear RGB, what most folk think of as “raw”, but now we know better… :grin:

  7. Add a blackwhitepoint tool. The default will be ‘auto/slider’, but select ‘data’ instead, then the ‘min white’ checkbox. You have blown highlights in the sample image; ‘min white’ will push them out past display white and get rid of the highlights’ magenta cast. In other tools, you get this scaling automatically, but you’re using rawproc… :stuck_out_tongue_closed_eyes:

If all that went okay, you should have a reasonable RGB. Now, if white balance didn’t go well, it may be that libraw didn’t read the raw file whitebalance multipliers. I’m not at the right computer to do that, but you can get them out of the file with exiftool. exiftool -G <raw filename> will do the trick; look for ‘Red Balance’ and ‘Blue Balance’ in the Composite tags. If you can’t find those, you’ll need to do it by-hand; I’ve had decent success using the histogram to do this. Color casts usually show up as offsets of the channels at the high end; using green as the anchor, if the blue channel is ‘lower’, increase the blue multiplier, and vice versa. Do the same for the red channel, and the image color should improve when the histogram channels line up on the right-hand side.

Okay, a bit much, but in doing this you’ll see a few essential thing at play in turning a really-raw image into a presentable depiction. Let me know how it goes…

Thanks, that helped a lot! That gets it much closer to the result I had from 0.6.2. I used input.raw.libraw.rawdata=1 and I think that was the missing piece. Does the display profile affect anything more than the preview? I set it anyway, just in case.

With colorspace, pasting in the primaries and hitting enter only seems to change the message that is triggered when saving (“no CMS profile found, saving with the assigned internal color profile” vs “no internal working profile found, saving without a color profile”). The actual file it saves is identical with or without colorspace added, despite the changed message when colorspace is added with primaries. I can also put 9 random values into the colorspace assign field, and it will also change the dialog to say it is using the assigned space but the file saved remains unchanged. No matter the value of colorspace, it also doesn’t change the preview.

It lacked gamma after all that, so I also added a gamma:2.4 at the end (2.2 was ok too but a bit dark, and 0.6.2 seemed to use 2.4, so for my purpose I preferred 2.4).

Good. I’m learning from your experience, by the way. I’ve been my only customer to date, and I’m rather tolerant of myself… :grin:

First, I think I forgot a key property to make all this color stuff work, cms.profilepath. This property needs to point to the directory where you’ll store all of your ICC profiles - camera, working, or output. Anytime rawproc needs a profile, it looks for it in this directory. When I downloaded @Elle’s excellent profiles, I just set mine to that directory and I added to it my display and camera profiles as I created them. So, set up that directory somewhere and set cms.profilepath to point to it before you do anything else…

Nothing other than the display image pane. File output is indeed separate, and I’ll discuss that below…

Ah, now I need to describe what to do with making file renditions, e.g., JPEGs. Assigning a camera space was only half the requirement for display, and the same thing applies to file output. Need to specify an output profile for export to files, same as we do for display. To do that, set the property output.jpeg.cms.profile=some_sRGB_profile.icc. With that file, rawproc will, if the internal image has an assigned profile, will convert the image from the assigned profile’s colorspace to the colorspace (and tone, will get to that in a bit) of the output.jpeg.cms.profile before saving the image to the JPEG file.

To handle this, my recommendation is to let the output profile do the work. @Elle’s profiles all come with different versions based on the tone curve, or TRC in ICC-speak. For instance, “sRGB-elle-V2-g22.icc” has a gamma 2.2 tone curve, and when used as an output profile will compel the transform change the image to that gamma. The key thing with making rendition files of your images is to insure the file contains a profile that accurately represents the image colorspace and tone. That way:

  • color-managed viewer software knows what to do with it.
  • Using sRGB profile helps non-color-managed viewer software ‘do the least harm’ as it just blats the image to the screen.
  • Oh, and using a V2 (ICC Version 2) profile for JPEGs is a good idea presently, as not all color-managed viewers handle V4 profiles. rawproc, due to the excellent LittleCMS library it uses, handles both.

You might want to queue this in your reading list:

I wrote it last year to generically describe the mechanics of color management in raw image processing. It follows our discussion here pretty well.

I know this is a lot to deal with, but once it’s set up it’s all pretty straightforward to use. More importantly, doing all this by-hand provides a crucial experience with how raw processing works end-to-end, with as few abstractions as possible to cloud your understanding. Even dcraw was doing things for you, with rawproc 0.9, you can become personally responsible for every single step… :grin:

Thanks, this is all great information, and stuff I want to understand better!

One other question, when I used 0.6.2, and had use_camera_matrix on with colorspace set to adobe, it exported a file with a profile named “dcraw D65-adobe, gamma 2.4”. What was rawproc doing to build that profile, and how I can replicate it in 0.9? There was no camera matrix available (I presume, being too new of a camera) so I’m guessing rawproc built a default of some kind? I really liked the look I was getting.

It’s been so long since I’ve used that processing; I had to go run one… :smiley:

So, if you set the following parameters such:
input.raw.libraw.rawdata=0
input.raw.libraw.colorspace=adobe
inpug.raw.libraw.gamma=srgb

The image at input is already RGB, converted to and assigned the adobe colorspace, and the srgb gamma preset gets you 2.4, but that’s already what you were doing in 0.6.2… But, if you save this to JPEG without putting a profile in output.jpeg.cms.profile, rawproc will save the JPEG with that internal profile.

in rawproc I use the dcraw primaries to build the dcraw profiles for assigning to the dcraw images; it’s all internal, and i don’t have files of them. One way to get a ICC file would be to use exiftool to extract it from a processed image that has the profile embedded:

$ exiftool -icc_profile -b -w icc somefile.jpg #courtesy Phil Harvey, from his forum.

Then, put it in the directory pointed to by cms.profilepath and you can use it anyplace in rawproc you can specify a profile.

1 Like

Hi Glenn, making a try with rawproc. I don’t know if that’s a good time…
I’ve followed your doc without (seeing) any issue, including librtprocess and wxWidgets, until the make of rawproc itself where I get this:

…/…/src/rawimage.cpp:407:30: error: ‘struct libraw_data_t’ has no member named ‘rawparams’; did you mean ‘params’?
407 | RawProcessor.imgdata.rawparams.shot_select = 0;
| ^~~~~~~~~
| params
…/…/src/rawimage.cpp:574:38: error: ‘struct libraw_data_t’ has no member named ‘rawparams’; did you mean ‘params’?
574 | RawProcessor.imgdata.rawparams.shot_select = atoi(p[“shot_select”].c_str());
| ^~~~~~~~~
| params

I’m running Debian sid, cmake version 3.22.1, GNU Make 4.3 and g++ (Debian 11.2.0-12) 11.2.0. Any tip to go further ? TIA.

Yep, those changes showed up with the most recent libraw snapshot. I accommodated them in the just-released 1.2 code.

If you prefer to continue with the source tree you have, make the changes specified here:

https://github.com/butcherg/rawproc/commit/514e22fcdb5acce1960e59ae91790403ea5cb924

Ok, my libraw version is 0.20.2-2.
I’ll make a try reverting the above commit.
Thanks!

Went alooking for where they made the change, couldn’t find it. Last good link before that change was with the 202101 snapshot…

I can launch rawproc, get the help.
When I open an image and accept apply colorspace I get this.



image

And maybe some others…
Then it opens the image and I can start to explore the tool ! :smile:

EDIT1 On github it is said :

requires the user to specify a profile directory…

Where I have to do that ?

EDIT2
On the console I’ve a log of this:

(rawproc:42149): Gtk-CRITICAL **: 21:16:16.751: gtk_box_gadget_distribute: assertion ‘size >= 0’ failed in GtkCheckButton

It looks like you’re using wxWidgets 3.1.5. I need to sort out where that’s happening, but for now I recommend using 3.1.4. If you don’t mind clicking through them, there’s no harm.

In the properties, you need a cms.profilepath. rawproc expects to find all of the ICC profiles in that directory, camera, working, and display/export.

Open the help, go to “How to use rawproc”. Right at the top of that page is a Setup section that’ll tell you about all the properties that you need to get started.

Gtk kicks a lot of these, with no consequence. I stopped chasing them a while back when I couldn’t find them in rawproc; appear to be in wxWidgets.

Thanks for the answers. Started to read the help !

1 Like

I find it really handy to help me remember what I coded… :laughing:

Settings. Whatever the icc profile I select for display.cms.displayprofile (including sRGB.icc) I get “CMS:disp_error (-)” in the bottom bar and the image darkens. Is that ok ?

Hmmm… the only thing that comes to mind immediately is that there’s no input profile for the display transform. Somewhere in the tool chain before where you want to display (the checked tool is the displayed image), insert a colorspace tool and assign a profile there, either select the camera profile at the bottom of the params pane or specify a file in the file box.

If you opened a JPEG or other rendition format that contained an embedded profile, that should be used, without having to assign a profile manually…

Edit: if you have a suitable input profile for the display transform, you should see “CMS: display(-)” or “CMS: display(n)” with a number corresponding to the display upon which rawproc sits if you defined mulitiple display profiles.

Put this in input.raw.default:

group:colorspace:camera,assign;subtract:camera;whitebalance:camera;demosaic:proof blackwhitepoint:rgb,data

This will process any opened raw to a linear RGB. You can subsequently break the group apart by right-clicking the group tool and selecting “Convert group to tool list”, and then be able to modify the individual tools. Or, just change the group in input.raw.default to remove the group…