Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard-deprecate haze removal? #18384

Open
kofa73 opened this issue Feb 9, 2025 · 7 comments
Open

Hard-deprecate haze removal? #18384

kofa73 opened this issue Feb 9, 2025 · 7 comments

Comments

@kofa73
Copy link
Contributor

kofa73 commented Feb 9, 2025

Is your feature request related to a problem? Please describe.

This module has been the source of constant issues, surprises when exporting.

Describe the solution you'd like

Not have it available any more for new edits. We have diffuse or sharpen, and one can use other modules to add contrast.

Alternatives

Keep it; maybe add another section to the bug report form to check if haze removal is causing problems; add a huge warning to the manual, saying if haze removal is active, the only way to ensure export matches the darkroom is to have HQ processing enabled both in the darkroom and in the export module. there is no way to guarantee consistency between darkroom preview and export.

@KarlMagnusLarsson
Copy link

KarlMagnusLarsson commented Feb 9, 2025

I am neutral when it comes to alternatives proposed. I do not use the dehaze module.

This module has been the source of constant issues, surprises when exporting.

If we go the other way and file issues and correct them, then I can list recent issue examples:

@kofa73
Copy link
Contributor Author

kofa73 commented Feb 9, 2025

Fixes are unlikely, based on #17358 (comment)

@kofa73
Copy link
Contributor Author

kofa73 commented Feb 10, 2025

Changed the description: even HQ does not help.

@jenshannoschwalm
Copy link
Collaborator

I am not absolutely sure about the quality of the algorithm, if it is principally/mathematically better than what other modules offer we should keep it and modify the algorithm.

Iirc we currently calculate some "correction data" from preview pipe processed output which is not available while direct export. We could possibly always use those "correction data" from a downscaled image simulating the preview.

@kofa73
Copy link
Contributor Author

kofa73 commented Feb 11, 2025

Could the input to calculate params not be taken from the output of the previous module? Then, at least when HQ is enabled both in the darkroom and in the export module, the results would match. Without the HQ setting, only the ROI is available, of course - fall back to the preview, in that case?

@jenshannoschwalm
Copy link
Collaborator

The output of previous module is always the input for current :-)

This is absolutely not sufficient as the distance is calculated from full image data (leaving cropping aside). If you look at the code you will recognize there will be subtle differences for full-preview vs full-fullpipe, the area is identical but for the preview we did downsampling before (that's what we use in darkroom) but for exports the data are calculated from not-downscaled. You can also observe those differences for HQ vs non-HQ export, the downscaling happens either in the demosaicer or finalscale for raws, for non-raws we downscale either at pixelpipe input or finalscale.

So in short - for me the downscaling leads to subtly different results. You can also observe that this depends on the interpolator (bilinear less difference than lanczos3 for example).

What we could do for export pipes when having full data- we could downscale exactly as we do for the preview pipes and calculate the distance based on that - to get rid of the differences.

The differences also depend on the colorspace being in, with 5.0 there are improvements but not fully solved.

@kofa73
Copy link
Contributor Author

kofa73 commented Feb 11, 2025

Yes, of course the input always comes from the previous module :)

What I meant was the 'auxiliary input', or 'intermediate data', which comes from the preview pipe:

It calculates some intermediate data from all available areas and does some maths using this intermediate stuff. [...]
the mentioned intermediate step happens in the preview pipe iirc

Could that not be taken from the current (darkroom, export) pipe instead? In that case, if I understand correctly, at least with HQ darkroom + export processing, the full image area is available at full resolution, so export would match the darkroom view.

@kofa73 kofa73 changed the title Hard-deprecate haze removal Hard-deprecate haze removal? Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants