Does MultiscaleMedianTransform do unnecessary work when Target is Chrominance (restore CIE Y)?

johnpane

Well-known member
From the console output, it appears as though MultiscaleMedianTransform may perform operations on the Y channel even if chrominance is targeted and the original Y channel will be restored. In the console output shown below , noise reduction was performed on layers 2 & 3 and it shows (and takes similar amounts of time) performing this on three channels.

Also, the console output mentions the L* channel even though the interface indicates that when targeting chrominance MMT decomposes the image into CIE XYZ componenents, i.e. I would expect it to refer to Y rather than L*.

Finally, is there a reason not to offer to operate on the a and b components of L*ab as an alternative to X and Z of XYZ?

Code:
MultiscaleMedianTransform: Processing view: integration_crp_dbe_pcc_ezdn_asinh_ezsr
Writing swap files...
451.536 MiB/s
Computing CIE L* component: done
Processing channel #0
Multiscale median transform: done
Processing layer #2
Smoothing layer: done
Processing layer #3
Smoothing layer: done
Multiscale reconstruction: done
Processing channel #1
Multiscale median transform: done
Processing layer #2
Smoothing layer: done
Processing layer #3
Smoothing layer: done
Multiscale reconstruction: done
Processing channel #2
Multiscale median transform: done
Processing layer #2
Smoothing layer: done
Processing layer #3
Smoothing layer: done
Multiscale reconstruction: done
Normalizing sample values: done
Importing CIE L* component: done
 
  • Like
Reactions: dld
the console output mentions the L* channel even though the interface indicates that when targeting chrominance MMT decomposes the image into CIE XYZ componenents, i.e. I would expect it to refer to Y rather than L*.

Bug confirmed, thank you for discovering and reporting it. Indeed it should be restoring CIE Y when the chrominance is selected. This will be fixed with an update ASAP. In the meanwhile, an easy workaround is as follows:

- On the MMT interface, select the Chrominance (restore CIE Y) target mode.​
- Click the Edit Instance Source Code button (void square icon).​
- Change the following line:​
P.linear = false;
to:​
P.linear = true;
- Click the Commit button (green checkmark, top right corner).​
- Execute the process. The CIE Y component will be extracted and restored instead of CIE L*.​

Make sure that MMT does not have the transformed image in its internal cache before doing this. In other words, don't apply the instance to the same image with P.linear = false.

it appears as though MultiscaleMedianTransform may perform operations on the Y channel even if chrominance is targeted

Not at all. The CIE Y component is just extracted at the beginning of the process and then restored after it completes. This effectively limits the transformation to the chroma components of the target image.

Finally, is there a reason not to offer to operate on the a and b components of L*ab as an alternative to X and Z of XYZ?

As you know the CIE L*a*b* color space is nonlinear. CIE XYZ is strictly linear. By working on XYZ the process is independent on the gamma transformation of the image's RGB working space, and the result is equally valid for both linear and nonlinear images. The goal here is achieving perfect isolation between luminance and chrominance without altering the linearity/nonlinearity of the image.
 
  • Like
Reactions: dld
Thank you for your fast response, Juan, and for explaining the very good reason why it operates in the CIE XYZ color space and not CIE L*a*b*.

it appears as though MultiscaleMedianTransform may perform operations on the Y channel even if chrominance is targeted
Not at all. The CIE Y component is just extracted at the beginning of the process and then restored after it completes. This effectively limits the transformation to the chroma components of the target image.

Yes, of course the end result is to leave the CIE Y component unchanged. I was just noting that the process seems to perform computation on the Y channel that is unnecessary since it will not be retained.
 
Back
Top