Skip to content

Fix HSL transformation for white and black images

Fix HSL, HSV, HCI and HCY transformations for white and black images

Basically, the transformations are substituted with their chroma-based counterparts, with clever sliding on the edges of the triangle.

The new filters behave a bit differently, therefore the patch adds a "Compatibility Mode" switch for the filter. It enables old behavior.

https://bugs.kde.org/show_bug.cgi?id=411863

Test Plan

Testcase 1:

  1. Open any image with a lot of dark and light areas
  2. Press Ctrl+U to open HSV-filter
  3. Select "Hue/Saturation/Lightness" (default choice)
  4. Try to increase/decrease "Lightness"
  5. Try to increase/decrease "Saturation"
  6. Repeat for HSV, HCI and HCY modes
  7. Compare with "Compatibility Mode", which it old implementation

Testcase 2:

  1. Create an image with HSV filter layer or mask in Krita 4.2.7 AppImage
  2. Try to load this image in this version. It should

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • [] I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports