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

Regression from 2.13 when interpolating CMYK colours #345

Closed
amyspark opened this issue Nov 28, 2022 · 11 comments
Closed

Regression from 2.13 when interpolating CMYK colours #345

amyspark opened this issue Nov 28, 2022 · 11 comments

Comments

@amyspark
Copy link
Contributor

amyspark commented Nov 28, 2022

Hi @mm2,

We've gotten this bug reported against Krita 5.1.3, where we upgraded Little CMS to 2.14.

Between 2.13.1 and 2.14, something broke in the interpolation of CMYK colors, at least in 8-bit depth:

2.13.1 2.14
imagen imagen

I'm not sure where in the commit log it happened, but disabling the fast float plugin has no effect. The offending profile is: https://bugs.kde.org/attachment.cgi?id=154115

@amyspark
Copy link
Contributor Author

It only affects CMYK with 8-bit integer depth, 16-bit and float appear to be unaffected.

@mm2
Copy link
Owner

mm2 commented Nov 28, 2022

Hello,
I cannot reproduce this with tificc. Could you please give me more details?

Specifically:

  • the profile is used as input or output?
  • which intent?
  • any special flags, black point compensation?
  • to which / from which profile are you doing the transform?

I used from/to built-in sRGB:

tificc -t0 -i AP_Munken_Print_White_260v4.1.icm ramps_cmyk.tif out-14-rgb.tif
tificc -t0 -o AP_Munken_Print_White_260v4.1.icm ramps.tif out-14-cmyk.tif

Both gives same result as 2.13.1

Probably I am missing something important.

@mm2
Copy link
Owner

mm2 commented Nov 28, 2022

Checked other intents too, and BPC as well. All works fine to me.

@amyspark
Copy link
Contributor Author

the profile is used as input or output?

Input.

which intent?

Perceptual.

any special flags, black point compensation?

Only black point compensation and the fast float plugin enabled.

to which / from which profile are you doing the transform?

sRGB-elle-V2-srgbtrc (output, 8-bit integer depth).

I'll try to bisect now and see if I can trap the regression.

@mm2
Copy link
Owner

mm2 commented Nov 28, 2022

The plain CMM without plugin works fine in this configuration. I have to build a tificc with the plugin, maybe the issue is in the plugin. Tomorrow will try to do that.

@amyspark
Copy link
Contributor Author

Git bisected between lcms2.13.1 and current HEAD (with a couple edits to build the fast float plugin under Meson-- btw, thanks for having it!)

Seems that one of the optimizations went awry:

❯ git bisect bad
d24a40c9cc685b7145e8082606d5d9384d08e472 is the first bad commit
commit d24a40c9cc685b7145e8082606d5d9384d08e472
Author: Marti Maria <marti.maria@littlecms.com>
Date:   Sun Feb 20 16:07:41 2022 +0100

    Fix LUT based optimization on 8 bits

    Most times, optimization was discarded where it could be used. Monotonicity is not needed here. Added a small demo.

 plugins/fast_float/src/fast_8_tethra.c |   6 +-
 plugins/fast_float/testbed/demo_cmyk.c | 151 +++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+), 5 deletions(-)
 create mode 100644 plugins/fast_float/testbed/demo_cmyk.c

@mm2
Copy link
Owner

mm2 commented Nov 29, 2022

This makes sense.
Seems a bug in the plug-in to me.
The bug was hidden in 2.13.1 because the profile was rejected for the plug-in and handled by the core engine. Now it is accepted, so the bug shows up. Will try to fix it ASAP.

@mm2
Copy link
Owner

mm2 commented Dec 4, 2022

This is a nasty bug on the plugin. Only affects 8 bits and CMYK. I will temporally disable CMYK on it 8 bits since the speed improvement is very small.

@mm2
Copy link
Owner

mm2 commented Dec 4, 2022

See 328c226

@mm2
Copy link
Owner

mm2 commented Mar 4, 2023

Fixed in 2.15

@mm2 mm2 closed this as completed Mar 4, 2023
@amyspark
Copy link
Contributor Author

amyspark commented Mar 4, 2023

@mm2 judging by the commit log, it seems there was no better solution found yet, right?

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

2 participants