I’m playing with the new Blurs module in 3.8, and trying to mask off some the areas I want to apply the blur. My goal is to create a DOF/Bokeh effect to isolate subjects.
The weird thing is, when I adjust the mask, it also modifies the blur quality - is that intentional or am I missing a setting?
The blurring process does not take scene depth and depth-of-field into account, but blurs the whole image as a flat object. It is therefore not suitable for creating fake depth-of-field. Using darktable’s general masking will only partially work to isolate the foreground of an image, since it will still be blurred into the background.
IMO this makes the module quite unusable for the designed purpose due to the subject leaking into the background, as the module is not aware of the mask.
From the manual:
lens blur: Simulates a lens diaphragm with a configurable number of blades and blade curvature to create synthetic bokeh.
…
blurs the whole image as a flat object. It is therefore not suitable for creating fake depth-of-field.
If you have some trick to workaround this limitation, please share…
This seems strange… the dark part seems still leaking into the blur area and there is also weird artifact above i’m not sure where it comes from, maybe mask.
It’s probably not possible to know what is going on here without the original image and image with the mask view.
No mystery just a crappy mask. I made no effort to isolate the background with the mask, its literally a very quick rough circle mask inverted to protect part of the image…ie an approximation of the clock face for effect/demonstration.
This image is taken from another thread and when I said coarse mask I meant that I drew a circle in 2 seconds with no real adjustment and only rough placement with no regard to the edges. I was not trying to mask out the clock with any effort just to demonstrate that the mask is available in the module and will control the application of the blur…
I think the issue is the following (it was described before, but just to add some pictures):
Test image
The subject on the right should be blurred, but not the edge on the left.
Mask
Blur applied
While the edge is intact towards the left, the blur is visible on the right of the edge since the whole image is blurred and then the mask is applied.
There might be a not too difficult fix, but my C knowledge is way below zero, so I cannot test it:
Assumption: The main application of masks in that case is blurring of the background. The mask is not necessarily binary, such that this assumption is important. As the mask will layer the blurred and the unblurred image, for the blurred version, a binary mask can be assumed which includes all regions where the mask is not equal zero, as the blurred background will then be layered with the not blurred foreground:
Compute a binary mask which includes every parts where the mask is not 0.
Inpaint the picture based on the inverse binary mask. Even a fast algo should do as this is going to be blurred anyway.
Blur the inpainted picture.
Apply the original picture based on the non-binary, original, mask, onto the blurred image.