Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.88k stars 323 forks source link

Make the White Balance sampling tool more flexible #5717

Open teplit opened 4 years ago

teplit commented 4 years ago

Summary

Make it possible to sample a bigger contiguous area (or multiple disconnected areas) for determination of White Balance.

Rationale

The human perception of white, gray and black isn’t precise and depends on the visual context. What may look as gray to human with normal color vison in particular spot of the image may turn out as quite tinted shade of gray. The tint of a gray shade acting as a sampling color usually have a strong impact on the White Balance.

A gray object in a photographed scene may receive light from multiple light sources (primary and secondary) with different color spectrum. Sampling the color of such an object with a spot White Balance tool in RAW editor is not a trivial task, because different parts of it may have different and difficult to notice tints, caused by the different lights.

The White Balance sampling tool is currently restricted to 32×32 pixels square maximum, which is really small area for RAW images with high count of pixels (e.g. 100+ MP RAWs).

Realization

With White Balance sampling tool acting as a brush (with adjustable size) it should be easy to enforce the statement “These regions should have neutral colors as much as possible.”, no matter the sizes and shapes of the regions or whether or not they are sparsely located in the image.

Note

The proposal assumes that the White Balancing task will be performed on a properly calibrated and profiled monitor under normal level and color of environmental light.

Thanatomanic commented 4 years ago

If you believe the spot picker is too small, a relatively simple change would be to modify the module to allow a larger range of sizes (replace the dropdown with an adjuster or spinbutton).

Drawing areas for white balancing, or having multiple areas for white balancing, is a lot more involved. It would probably require significant changes to how the image canvas is drawn and handled (and personally I don't fancy touching crop.cc at all 😜 ).

teplit commented 4 years ago

I believe that the flexibility, convenience and innovation will make RawTherapee more attractive to more people.

Programming is of course involving activity – it requires technical expertise, experience and knowledge. If you don’t like it – don’t do it.

Photography is also involving activity – some people risk their equipment, health and life for capturing difficult to reach scenes in difficult conditions. If you think that it is fun to walk alone in deep snow with snow-shoes in the mountain the whole day I strongly recommend you to do it. The scenes are quite tranquil and the possibility to die from hypothermia is not imaginary if you make a mistake.

Thanatomanic commented 4 years ago

I understand your response, but it seems you missed my intended point. You know we're an open source project, right? If you ask for a feature, and you're told it is a big thing, please accept any 'quick fix' at face value. Don't expect me or any other dev to say "sure, we'll have this done in two weeks" - which is kind of what your response implies.

Let's see what others think about this (perfectly reasonable!) feature request.

teplit commented 4 years ago

My native language is not English and my style of wording my look odd. So to clarify the matters – the proposal is not about performing local white balancing on photos with multiple light sources. Some researchers tried to do that and achieved interesting results at least in their paper (Light Mixture Estimation for Spatially Varying White Balance). The proposal is about performing global white balance via sampling of one or more regions with irregular shape or big size (how big is big depends on the size of the image).

In darkroom 3.0.1 the White balance sampling is implemented as rectangular drawing tool. This is more flexible than a square with fixed size, however it is not intuitive - users of other RAW editors may expect the tool to behave as spot sampling tool (it is called spot in the user interface). That’s why I think a brush will be a better extension for a spot sampling tool – it can act as a simple sampling tool (for single mouse click) and it can act as painting brush (for mouse click combined with mouse movement). For sampling multiple regions a keyboard key (Ctrl or Shift) may be employed.

Next it is necessary to decide how to emphasize the sampling regions, in order to visually separate them from the rest of the image without affecting the colors in them.

I do not expect speedy implementation (I don’t use development versions of RawTherapee). I guess you realize that writing bug reports or feature requests and trying to prove that they are real/worthwhile also cost time and efforts. I don’t do that because I hate RawTherapee – several years ago I switched from Lightroom and I reprocessed most of my old RAW files in RawTherapee with better outcome.