lcms-user Mailing List for Little cms color engine (Page 4)
An ICC-based CMM for color management
Brought to you by:
mm2
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(15) |
Jun
(24) |
Jul
(9) |
Aug
(14) |
Sep
|
Oct
(12) |
Nov
(17) |
Dec
(31) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(34) |
Feb
(7) |
Mar
(7) |
Apr
(16) |
May
(4) |
Jun
(14) |
Jul
(34) |
Aug
(54) |
Sep
(11) |
Oct
(25) |
Nov
(1) |
Dec
(6) |
| 2003 |
Jan
(27) |
Feb
(54) |
Mar
(23) |
Apr
(68) |
May
(82) |
Jun
(36) |
Jul
(45) |
Aug
(45) |
Sep
(49) |
Oct
(30) |
Nov
(65) |
Dec
(23) |
| 2004 |
Jan
(52) |
Feb
(52) |
Mar
(35) |
Apr
(38) |
May
(93) |
Jun
(22) |
Jul
(51) |
Aug
(50) |
Sep
(73) |
Oct
(28) |
Nov
(30) |
Dec
(51) |
| 2005 |
Jan
(22) |
Feb
(79) |
Mar
(38) |
Apr
(51) |
May
(95) |
Jun
(60) |
Jul
(56) |
Aug
(49) |
Sep
(22) |
Oct
(43) |
Nov
(15) |
Dec
(40) |
| 2006 |
Jan
(51) |
Feb
(31) |
Mar
(37) |
Apr
(25) |
May
(9) |
Jun
(13) |
Jul
(17) |
Aug
(66) |
Sep
(7) |
Oct
(12) |
Nov
(14) |
Dec
(31) |
| 2007 |
Jan
(18) |
Feb
(9) |
Mar
(22) |
Apr
(18) |
May
(5) |
Jun
(25) |
Jul
(2) |
Aug
(15) |
Sep
(12) |
Oct
(40) |
Nov
(10) |
Dec
(23) |
| 2008 |
Jan
(21) |
Feb
(56) |
Mar
(12) |
Apr
(23) |
May
(47) |
Jun
(75) |
Jul
(24) |
Aug
(2) |
Sep
(7) |
Oct
(26) |
Nov
(20) |
Dec
(16) |
| 2009 |
Jan
(14) |
Feb
(1) |
Mar
(29) |
Apr
(54) |
May
(18) |
Jun
(16) |
Jul
(5) |
Aug
(3) |
Sep
(38) |
Oct
(6) |
Nov
(25) |
Dec
(28) |
| 2010 |
Jan
(11) |
Feb
(26) |
Mar
(2) |
Apr
(10) |
May
(45) |
Jun
(94) |
Jul
(11) |
Aug
(32) |
Sep
(18) |
Oct
(37) |
Nov
(19) |
Dec
(34) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(16) |
Apr
(29) |
May
(17) |
Jun
(18) |
Jul
(7) |
Aug
(21) |
Sep
(10) |
Oct
(7) |
Nov
(15) |
Dec
(6) |
| 2012 |
Jan
(13) |
Feb
(16) |
Mar
(15) |
Apr
(12) |
May
(15) |
Jun
(31) |
Jul
(22) |
Aug
(15) |
Sep
(46) |
Oct
(21) |
Nov
(15) |
Dec
(33) |
| 2013 |
Jan
(19) |
Feb
(17) |
Mar
(31) |
Apr
(17) |
May
(27) |
Jun
(24) |
Jul
(26) |
Aug
(11) |
Sep
(9) |
Oct
(22) |
Nov
(14) |
Dec
(16) |
| 2014 |
Jan
(20) |
Feb
(66) |
Mar
(29) |
Apr
(13) |
May
(9) |
Jun
|
Jul
(11) |
Aug
(21) |
Sep
(15) |
Oct
(5) |
Nov
(5) |
Dec
(10) |
| 2015 |
Jan
(6) |
Feb
(26) |
Mar
(26) |
Apr
|
May
(9) |
Jun
(5) |
Jul
(5) |
Aug
(11) |
Sep
(8) |
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
(3) |
Feb
|
Mar
(9) |
Apr
(3) |
May
(16) |
Jun
(26) |
Jul
(32) |
Aug
(27) |
Sep
(9) |
Oct
|
Nov
(4) |
Dec
(10) |
| 2017 |
Jan
(11) |
Feb
(44) |
Mar
(6) |
Apr
(8) |
May
(1) |
Jun
(2) |
Jul
(34) |
Aug
(28) |
Sep
(3) |
Oct
(9) |
Nov
(3) |
Dec
|
| 2018 |
Jan
(1) |
Feb
(5) |
Mar
(6) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(6) |
Oct
|
Nov
(6) |
Dec
|
| 2019 |
Jan
(18) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(7) |
Sep
(3) |
Oct
(10) |
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(17) |
Jun
(23) |
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(10) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
(1) |
Dec
|
| 2022 |
Jan
(8) |
Feb
|
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(13) |
Nov
(12) |
Dec
|
| 2023 |
Jan
|
Feb
(1) |
Mar
(9) |
Apr
|
May
(3) |
Jun
(5) |
Jul
(3) |
Aug
(8) |
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
| 2024 |
Jan
(8) |
Feb
|
Mar
(14) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
|
|
From: <mar...@li...> - 2022-11-30 19:27:42
|
Hello, >As I am trying to make sense of it, I notice that the XYZ numbers you cited are off by two digits. According to ICC.1:2022, chapter 6.3.4.3, they should be: >> XYZ values for the PCS perceptual black point (X = 0,003357, Y = 0,003479, Z = 0,002869) ICC PCS uses XYZ values divided by 100, so Y in white point is represented by 1.0 instead of 100. Is just a matter of encoding. Regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Ralf Junker <ral...@gm...> Sent: Wednesday, November 30, 2022 11:01 AM To: lcm...@li... Subject: Re: [Lcms-user] Unexpected gray to RGB result On 29.11.2022 20:00, mar...@li... wrote: > ICC spec expects a "good" V4 perceptual profile to return "perceptual black" > on darkest colorant (gray=0). This is around Lab=(3.14, 0, 0) or XYZ=( > 0.3357, 0.3479, 0.2869). Thanks for explaining! As I am trying to make sense of it, I notice that the XYZ numbers you cited are off by two digits. According to ICC.1:2022, chapter 6.3.4.3, they should be: > XYZ values for the PCS perceptual black point (X = 0,003357, Y = 0,003479, Z = 0,002869) I further noticed that lcms2.h uses slightly different values: // V4 perceptual black #define cmsPERCEPTUAL_BLACK_X 0.00336 #define cmsPERCEPTUAL_BLACK_Y 0.0034731 #define cmsPERCEPTUAL_BLACK_Z 0.00287 https://github.com/mm2/Little-CMS/blob/caab4c07e60022a0f776b543eaa30785e2bb4 2ed/include/lcms2.h#L280-L283 I also noticed that src/cmscam02.c contains the floating-point literal 3.141592654 three times, all of which could probably be replaced by M_PI for clarity, simplicity and accuracy. Ralf _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Robin W. <rob...@ar...> - 2022-11-30 10:52:01
|
On 30/11/2022 10:01, Ralf Junker wrote: > https://github.com/mm2/Little-CMS/blob/caab4c07e60022a0f776b543eaa30785e2bb42ed/include/lcms2.h#L280-L283 > > I also noticed that src/cmscam02.c contains the floating-point literal > 3.141592654 three times, all of which could probably be replaced by M_PI > for clarity, simplicity and accuracy. This would also guard us against the possibility of PI changing in future. Robin |
|
From: Ralf J. <ral...@gm...> - 2022-11-30 10:00:14
|
On 29.11.2022 20:00, mar...@li... wrote: > ICC spec expects a "good" V4 perceptual profile to return "perceptual black" > on darkest colorant (gray=0). This is around Lab=(3.14, 0, 0) or XYZ=( > 0.3357, 0.3479, 0.2869). Thanks for explaining! As I am trying to make sense of it, I notice that the XYZ numbers you cited are off by two digits. According to ICC.1:2022, chapter 6.3.4.3, they should be: > XYZ values for the PCS perceptual black point (X = 0,003357, Y = 0,003479, Z = 0,002869) I further noticed that lcms2.h uses slightly different values: // V4 perceptual black #define cmsPERCEPTUAL_BLACK_X 0.00336 #define cmsPERCEPTUAL_BLACK_Y 0.0034731 #define cmsPERCEPTUAL_BLACK_Z 0.00287 https://github.com/mm2/Little-CMS/blob/caab4c07e60022a0f776b543eaa30785e2bb42ed/include/lcms2.h#L280-L283 I also noticed that src/cmscam02.c contains the floating-point literal 3.141592654 three times, all of which could probably be replaced by M_PI for clarity, simplicity and accuracy. Ralf |
|
From: Christian S. <rea...@mo...> - 2022-11-30 07:11:45
|
> Am 30.11.2022 um 03:41 schrieb Kang Wei Hsu <beb...@gm...>: > > Just found there is a "CORE_RL_lcms_.dll" in the i1Profiler folder. And there are jpeg, libxml, magick, png and tiff .dll files. Other .dll files are obviously dependent libraries that i1Profiler uses. Does that mean X-Rite uses LCMS as i1Profiler's color engine? X-Rite always claimed they use their own i1Prism color engine. I'm just curious. Please note that GraphicsMagick library comes with CORE_RL_lcms_.dll included. So if they use GraphicsMagick to load images, it includes LCMS. e.g. DLLs in the GraphicsMagick package: CORE_RL_bzlib_.dll CORE_RL_zlib_.dll CORE_RL_xlib_.dll CORE_RL_wmf_.dll CORE_RL_webp_.dll CORE_RL_wand_.dll CORE_RL_ttf_.dll CORE_RL_tiff_.dll CORE_RL_png_.dll CORE_RL_Magick++_.dll CORE_RL_magick_.dll CORE_RL_libxml_.dll CORE_RL_lcms_.dll CORE_RL_jpeg_.dll CORE_RL_jp2_.dll CORE_RL_jbig_.dll CORE_RL_filters_.dll CORE_RL_coders_.dll Best regards, Christian -- Read our blog about news on our plugins: http://www.mbsplugins.de/ |
|
From: Kang W. H. <beb...@gm...> - 2022-11-30 02:41:35
|
Just found there is a "CORE_RL_lcms_.dll" in the i1Profiler folder. And there are jpeg, libxml, magick, png and tiff .dll files. Other .dll files are obviously dependent libraries that i1Profiler uses. Does that mean X-Rite uses LCMS as i1Profiler's color engine? X-Rite always claimed they use their own i1Prism color engine. I'm just curious. Kang-Wei |
|
From: <mar...@li...> - 2022-11-29 20:17:14
|
Hi, Thanks for checking. > One more question, if I may: You wrote that the fix is in the "algorithm to detect those bad profiles". What corrections would be needed to generate a good profile in the first place? ICC spec expects a "good" V4 perceptual profile to return "perceptual black" on darkest colorant (gray=0). This is around Lab=(3.14, 0, 0) or XYZ=( 0.3357, 0.3479, 0.2869). You profile was trying to trick the CMM by returning Lab=(100, 0, 0) on the darkest colorant. And made it crazy. Now it detects this and let you to take full control. Regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Ralf Junker <ral...@gm...> Sent: Tuesday, November 29, 2022 10:35 AM To: lcm...@li... Subject: Re: [Lcms-user] Unexpected gray to RGB result On 27.11.2022 17:44, mar...@li... wrote: > Now it is fixed by > https://github.com/mm2/Little-CMS/commit/caab4c07e60022a0f776b543eaa30 > 785e2bb42ed Thanks for the fix. I confirm it works well. lcms2 now generates visually identically image to Chromium, Firefox, and Gimp. One more question, if I may: You wrote that the fix is in the "algorithm to detect those bad profiles". What corrections would be needed to generate a good profile in the first place? Ralf _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Ralf J. <ral...@gm...> - 2022-11-29 09:34:31
|
On 27.11.2022 17:44, mar...@li... wrote: > Now it is fixed by > https://github.com/mm2/Little-CMS/commit/caab4c07e60022a0f776b543eaa30785e2bb42ed Thanks for the fix. I confirm it works well. lcms2 now generates visually identically image to Chromium, Firefox, and Gimp. One more question, if I may: You wrote that the fix is in the "algorithm to detect those bad profiles". What corrections would be needed to generate a good profile in the first place? Ralf |
|
From: <mar...@li...> - 2022-11-27 20:23:02
|
Hello, I was puzzled because I remember I added an algorithm to detect those bad profiles and hot-fix them. Upon reviewing the code, the algorithm was there but it failed on your profile! So, you hit the rare case of gray profile + wrong V4 encoding + apparent black point higher than L* > 50 + inverted curves. All that was confusing the black point compensation part that was supposed to fix the issue. Thank you very much to help in finding a very elusive bug. Now it is fixed by https://github.com/mm2/Little-CMS/commit/caab4c07e60022a0f776b543eaa30785e2b b42ed Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Ralf Junker <ral...@gm...> Sent: Sunday, November 27, 2022 9:41 AM To: lcm...@li... Subject: Re: [Lcms-user] Unexpected gray to RGB result Thanks for the fast answer! > The embedded profile is wrong. It claims to be V4 and perceptual, but > fails to scale on perceptual black. Here is the C code that generated the profile: int main() { const cmsCIExyY *whitepoint = cmsD50_xyY(); int i; cmsUInt16Number values[256]; cmsToneCurve *tonecurve; cmsHPROFILE profile; for(i = 0; i < 256; i++) { values[i] = (255 - i) * 65535 / 255; } tonecurve = cmsBuildTabulatedToneCurve16 (0, 256, values); profile = cmsCreateGrayProfile(whitepoint, tonecurve); cmsSaveProfileToFile(profile, "gray-inverted.icc"); } The goal is a profile which swaps blacks and whites, dark grays and white grays, to create an inverted, negative grayscale. The profile's purpose is testing image rendering software with color correction using lcms2. I found WhackedRGB.icc for color images, but nothing for grayscale. > Other CMM may choose to reject the profile, lcms uses it, despite it > is wrong. My bad, I take your point. Please note that the profile somehow works with Chromium, Firefox and Gimp which all show whites on the left and blacks on the right of the image. And they all show it identically. Viewers which do not apply the profile show blacks on the left and whites on the right. > See https://color.org/specification/ICC.1-2022-05.pdf > > "6.3.4.3 PCS encodings for white and black" Unfortunately, I am unable translate this technical specification into lcms2 code. Could you suggest a function or a chapter in the documentation? I found nothing obviously related, I'm afraid. Grateful, Ralf _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Ralf J. <ral...@gm...> - 2022-11-27 08:40:42
|
Thanks for the fast answer!
> The embedded profile is wrong. It claims to be V4 and perceptual,
> but fails to scale on perceptual black.
Here is the C code that generated the profile:
int main()
{
const cmsCIExyY *whitepoint = cmsD50_xyY();
int i;
cmsUInt16Number values[256];
cmsToneCurve *tonecurve;
cmsHPROFILE profile;
for(i = 0; i < 256; i++) {
values[i] = (255 - i) * 65535 / 255;
}
tonecurve = cmsBuildTabulatedToneCurve16 (0, 256, values);
profile = cmsCreateGrayProfile(whitepoint, tonecurve);
cmsSaveProfileToFile(profile, "gray-inverted.icc");
}
The goal is a profile which swaps blacks and whites, dark grays and
white grays, to create an inverted, negative grayscale.
The profile's purpose is testing image rendering software with color
correction using lcms2. I found WhackedRGB.icc for color images, but
nothing for grayscale.
> Other CMM may choose to reject the profile, lcms uses it, despite it
> is wrong.
My bad, I take your point. Please note that the profile somehow works
with Chromium, Firefox and Gimp which all show whites on the left and
blacks on the right of the image. And they all show it identically.
Viewers which do not apply the profile show blacks on the left and
whites on the right.
> See https://color.org/specification/ICC.1-2022-05.pdf
>
> "6.3.4.3 PCS encodings for white and black"
Unfortunately, I am unable translate this technical specification into
lcms2 code. Could you suggest a function or a chapter in the
documentation? I found nothing obviously related, I'm afraid.
Grateful,
Ralf
|
|
From: <mar...@li...> - 2022-11-27 00:27:38
|
Hi, The embedded profile is wrong. It claims to be V4 and perceptual, but fails to scale on perceptual black. See https://color.org/specification/ICC.1-2022-05.pdf "6.3.4.3 PCS encodings for white and black" "Perceptual transforms developed to meet ICC specifications prior to version 4.0 frequently use zero to represent the black point, and thus do not conform to this specification." Other CMM may choose to reject the profile, lcms uses it, despite it is wrong. Regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Ralf Junker <ral...@gm...> Sent: Saturday, November 26, 2022 11:13 PM To: lcm...@li... Subject: [Lcms-user] Unexpected gray to RGB result I try to use lcms2 to convert gray to RGB, but the output differs considerably. So I double-checked with jpgicc gray-inverted-profile-linear.jpg gray-rgb-linear.jpg but the result is the same: Unexpected saturation of dark gray areas to pitch black. As reference of the expected outcome, please take a look at gray-chromium.png to see how Chromium renders gray-inverted-profile-linear.jpg. Firefox and GIMP look just the same. Am I missing something? I am grateful for any advice! Ralf PS I hope the list accepts attachments. If not please advice how to send the images in question. |
|
From: Ralf J. <ral...@gm...> - 2022-11-26 22:12:24
|
I try to use lcms2 to convert gray to RGB, but the output differs considerably. So I double-checked with jpgicc gray-inverted-profile-linear.jpg gray-rgb-linear.jpg but the result is the same: Unexpected saturation of dark gray areas to pitch black. As reference of the expected outcome, please take a look at gray-chromium.png to see how Chromium renders gray-inverted-profile-linear.jpg. Firefox and GIMP look just the same. Am I missing something? I am grateful for any advice! Ralf PS I hope the list accepts attachments. If not please advice how to send the images in question. |
|
From: <mar...@li...> - 2022-11-01 16:21:07
|
Little CMS 2.14 released
I am glad to the announce the release 2.14 of the Little CMS open source color engine.
Changes
• lcms2 now fully implements ICC specification 4.4
• New multi-threaded plug-in
• several fixes to keep fuzzers happy
• Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used
• Added more validation against broken profiles
• Add more help to several tools
ICC Version 4.4 and the multithreaded plug-in are important milestones.
Fixes because fuzzers have been many, none of them harmful in terms of exploits.
Reach it at:
https://www.littlecms.com/color-engine/
Downloads:
https://sourceforge.net/projects/lcms/files/latest/download
Best regards,
Marti Maria The Little CMS project
http://www.littlecms.com
|
|
From: <mar...@li...> - 2022-10-31 18:41:11
|
Hi Noel, Those are very good numbers, thanks for sharing! Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Noel Carboni <NCa...@Pr...> Sent: Monday, October 31, 2022 11:14 AM To: mar...@li...; lcm...@li... Subject: Multi-threading Little CMS Performance on Modern High-End Hardware Hi Marti and Little CMS list members, I've been exercising Little CMS on a new AMD Threadripper Pro system. This machine has the AMD Ryzen Threadripper Pro 5975X processor with 32 cores (64 logical processors in Windows with SMT enabled). My software divides up the color management processing into multiple threads depending on several factors including image size, cache sizes, etc. I thought you might like to see some representative performance numbers from Little CMS doing RGB to RGB color transforms (from image to monitor profiles)... Note that I am NOT using the Little CMS plug-ins, just the base code, compiled for Windows using Visual Studio 2022. Performance Message: Total Time = 10.617 milliseconds, ConvertColorOf() - Completed color conversion using 63 simultaneous threads. Image: 3032 x 2016 pixels x 16 bits per color. Performance Message: Total Time = 15.247 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 3852 x 2598 pixels x 8 bits per color. Performance Message: Total Time = 18.508 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 4246 x 3925 pixels x 16 bits per color. Performance Message: Total Time = 50.934 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 8 bits per color. Performance Message: Total Time = 40.886 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 16 bits per color. Performance Message: Total Time = 241.950 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 32 bits per color. Extrapolating from the next to last 66 megapixel entry above, we're seeing more than 1.6 gigapixels per second color-transformed. -Noel Carboni ProDigital Software |
|
From: Noel C. <NCa...@Pr...> - 2022-10-31 10:14:38
|
Hi Marti and Little CMS list members, I've been exercising Little CMS on a new AMD Threadripper Pro system. This machine has the AMD Ryzen Threadripper Pro 5975X processor with 32 cores (64 logical processors in Windows with SMT enabled). My software divides up the color management processing into multiple threads depending on several factors including image size, cache sizes, etc. I thought you might like to see some representative performance numbers from Little CMS doing RGB to RGB color transforms (from image to monitor profiles)... Note that I am NOT using the Little CMS plug-ins, just the base code, compiled for Windows using Visual Studio 2022. Performance Message: Total Time = 10.617 milliseconds, ConvertColorOf() - Completed color conversion using 63 simultaneous threads. Image: 3032 x 2016 pixels x 16 bits per color. Performance Message: Total Time = 15.247 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 3852 x 2598 pixels x 8 bits per color. Performance Message: Total Time = 18.508 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 4246 x 3925 pixels x 16 bits per color. Performance Message: Total Time = 50.934 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 8 bits per color. Performance Message: Total Time = 40.886 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 16 bits per color. Performance Message: Total Time = 241.950 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 32 bits per color. Extrapolating from the next to last 66 megapixel entry above, we're seeing more than 1.6 gigapixels per second color-transformed. -Noel Carboni ProDigital Software |
|
From: <mar...@li...> - 2022-10-21 15:12:22
|
Hi > If so, a random thought... On x64 (with the Microsoft C++ compiler at least), just an (int) cast from a 32 bit float to 32 bit int, which compiles down to one x86 machine instruction - cvttss2si - will truncate to the next integer value in the direction of 0. No need to call a floor function at all. Thanks. Nowadays I tend to write code for clarity and let the compiler do the optimizations. In this case, it is hardly compiler dependent. On ARM for example, clang 11 generates fcvtms versus fcvtzs on other compiler things may change. For most compilers floorf is an intrinsic. Since the algorithm is described using floor, I use floor instead of an int cast. In fact, the mantissa trick I was using is no longer faster that the floorf function. After all the optimizer rearranges code so it depends on how well the whole thing parallelizes. Floorf uses xxmm instructions and those parallelize very well. Regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Noel Carboni <NCa...@Pr...> Sent: Friday, October 21, 2022 6:18 AM To: mar...@li... Cc: lcm...@li... Subject: RE: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi Marti, > Found the bug and fixed it in > https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cc > a9026bf2b27 Are all your px, py, pz values always non-negative at the point of the above changes to fast_float_tethra.c? If so, a random thought... On x64 (with the Microsoft C++ compiler at least), just an (int) cast from a 32 bit float to 32 bit int, which compiles down to one x86 machine instruction - cvttss2si - will truncate to the next integer value in the direction of 0. No need to call a floor function at all. If those values can be negative... Never mind. 😊 -Noel Carboni ProDigital Software -----Original Message----- From: mar...@li... <mar...@li...> Sent: Thu, October 20, 2022 1:24 PM To: 'L. E. Segovia' <am...@am...> Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hello, Found the bug and fixed it in https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 It is an AMAZING bug, triggered by an issue of precision loss. For those that enjoy this kind of things I will briefly describe what was happening. I used a tweaked floor() for speed. floor() function is supposed to return the largest integer value that is less than or equal to a number. My tweaked function was using mantissa tricks to run as fast as possible. It worked for all but a small number of combinations. Well, you hit one of those bad combinations. A number like 47.9993 (I think, I may be wrong on recalling the exact number). Quick floor of this particular number returned 48 when it really was 47. At the end its only 0.0007 difference so may seem harmless... BUT this was used for interpolation so a subtraction was involved. if we try to compute the node with that faulty floor and then subtract values to get the rest, we end in a negative number. And you know, negative number mixes bad with unsigned, so at the end this was creating a nasty out-of-bounds condition. Funny enough, very few numbers are capable of that. You were lucky enough to discover the bug because you hit a bad number with white with those profiles and flags otherwise this could go unnoticed for years. Many thanks for reporting. You earned the award of "bug of the year" because its rarity. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: L. E. Segovia <am...@am...> Sent: Thursday, October 20, 2022 3:46 AM To: mar...@li... Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi, The Krita code for the LCMS transform initialization is a nightmare... apart from a 10 y-o typo in the format definition (not declaring FLOAT_SH where we should), I've managed to consistently reproduce the bug. I've adjusted two lines below: > #include <lcms2.h> > #include <lcms2_fast_float.h> > > int main(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, > TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | > cmsFLAGS_HIGHRESPRECALC); > > float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f }; > float result[4] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } We at Krita use RGBA, and the given conversion flags: cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC. The pixel values were extracted straight from the exception stacktrace, and I've verified them separately. Best, amyspark On 19/10/2022 09:08, mar...@li... wrote: > > Hi, > > I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. > > int checkKrita(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, > TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); > > float ones[3] = { 1.0f, 1.0f, 1.0f }; > float result[3] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } > > BTW, are you linking the plug-in as a DLL? > > Regards > > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > -----Original Message----- > From: L. E. Segovia <am...@am...> > Sent: Wednesday, October 19, 2022 2:38 AM > To: Marti Maria <mar...@li...> > Cc: lcm...@li... > Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready > to be released > > Hey Marti, > > I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: > > lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, > const void * Input, void * Output, unsigned int PixelsPerLine, > unsigned int LineCount, const cmsStride * Stride) Line 199 > (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float > _tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * > InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 > (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) > > The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. > > Is there anything else I can do to help you reproduce it? > > Best, > > amyspark > > On 16/10/2022 16:40, Marti Maria wrote: >> Hello, >> >> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. >> >> Thanks >> Marti >> >> >>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >>> >>> Hey Marti, >>> >>> We've gotten a bug report at Krita regarding the fast float plugin: >>> >>> https://bugs.kde.org/show_bug.cgi?id=460512 >>> >>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >>> >>> Best, >>> >>> amyspark >>> >>> On 15/10/2022 15:38, Marti Maria wrote: >>>> I am glad to announce the imminent release of lcms2-2.14 The first >>>> release candidate is available here: >>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>>> Changes >>>> • lcms2 now fully implements ICC specification 4.4 >>>> • New multi-threaded plug-in >>>> • several fixes to keep fuzzers happy >>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>>> • Added more validation against broken profiles >>>> • Add more help to several tools >>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>>> Best regards >>>> Marti Maria >>>> The LittleCMS Project >>>> https://www.littlecms.com >>>> _______________________________________________ >>>> Lcms-user mailing list >>>> Lcm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> >>> -- >>> amyspark 🌸 https://www.amyspark.me >>> >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> > > -- > amyspark 🌸 https://www.amyspark.me > -- amyspark 🌸 https://www.amyspark.me _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Noel C. <NCa...@Pr...> - 2022-10-21 04:18:10
|
Hi Marti, > Found the bug and fixed it in > https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 Are all your px, py, pz values always non-negative at the point of the above changes to fast_float_tethra.c? If so, a random thought... On x64 (with the Microsoft C++ compiler at least), just an (int) cast from a 32 bit float to 32 bit int, which compiles down to one x86 machine instruction - cvttss2si - will truncate to the next integer value in the direction of 0. No need to call a floor function at all. If those values can be negative... Never mind. 😊 -Noel Carboni ProDigital Software -----Original Message----- From: mar...@li... <mar...@li...> Sent: Thu, October 20, 2022 1:24 PM To: 'L. E. Segovia' <am...@am...> Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hello, Found the bug and fixed it in https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 It is an AMAZING bug, triggered by an issue of precision loss. For those that enjoy this kind of things I will briefly describe what was happening. I used a tweaked floor() for speed. floor() function is supposed to return the largest integer value that is less than or equal to a number. My tweaked function was using mantissa tricks to run as fast as possible. It worked for all but a small number of combinations. Well, you hit one of those bad combinations. A number like 47.9993 (I think, I may be wrong on recalling the exact number). Quick floor of this particular number returned 48 when it really was 47. At the end its only 0.0007 difference so may seem harmless... BUT this was used for interpolation so a subtraction was involved. if we try to compute the node with that faulty floor and then subtract values to get the rest, we end in a negative number. And you know, negative number mixes bad with unsigned, so at the end this was creating a nasty out-of-bounds condition. Funny enough, very few numbers are capable of that. You were lucky enough to discover the bug because you hit a bad number with white with those profiles and flags otherwise this could go unnoticed for years. Many thanks for reporting. You earned the award of "bug of the year" because its rarity. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: L. E. Segovia <am...@am...> Sent: Thursday, October 20, 2022 3:46 AM To: mar...@li... Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi, The Krita code for the LCMS transform initialization is a nightmare... apart from a 10 y-o typo in the format definition (not declaring FLOAT_SH where we should), I've managed to consistently reproduce the bug. I've adjusted two lines below: > #include <lcms2.h> > #include <lcms2_fast_float.h> > > int main(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, > TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | > cmsFLAGS_HIGHRESPRECALC); > > float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f }; > float result[4] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } We at Krita use RGBA, and the given conversion flags: cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC. The pixel values were extracted straight from the exception stacktrace, and I've verified them separately. Best, amyspark On 19/10/2022 09:08, mar...@li... wrote: > > Hi, > > I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. > > int checkKrita(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, > TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); > > float ones[3] = { 1.0f, 1.0f, 1.0f }; > float result[3] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } > > BTW, are you linking the plug-in as a DLL? > > Regards > > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > -----Original Message----- > From: L. E. Segovia <am...@am...> > Sent: Wednesday, October 19, 2022 2:38 AM > To: Marti Maria <mar...@li...> > Cc: lcm...@li... > Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready > to be released > > Hey Marti, > > I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: > > lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, > const void * Input, void * Output, unsigned int PixelsPerLine, > unsigned int LineCount, const cmsStride * Stride) Line 199 > (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float > _tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * > InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 > (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) > > The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. > > Is there anything else I can do to help you reproduce it? > > Best, > > amyspark > > On 16/10/2022 16:40, Marti Maria wrote: >> Hello, >> >> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. >> >> Thanks >> Marti >> >> >>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >>> >>> Hey Marti, >>> >>> We've gotten a bug report at Krita regarding the fast float plugin: >>> >>> https://bugs.kde.org/show_bug.cgi?id=460512 >>> >>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >>> >>> Best, >>> >>> amyspark >>> >>> On 15/10/2022 15:38, Marti Maria wrote: >>>> I am glad to announce the imminent release of lcms2-2.14 The first >>>> release candidate is available here: >>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>>> Changes >>>> • lcms2 now fully implements ICC specification 4.4 >>>> • New multi-threaded plug-in >>>> • several fixes to keep fuzzers happy >>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>>> • Added more validation against broken profiles >>>> • Add more help to several tools >>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>>> Best regards >>>> Marti Maria >>>> The LittleCMS Project >>>> https://www.littlecms.com >>>> _______________________________________________ >>>> Lcms-user mailing list >>>> Lcm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> >>> -- >>> amyspark 🌸 https://www.amyspark.me >>> >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> > > -- > amyspark 🌸 https://www.amyspark.me > -- amyspark 🌸 https://www.amyspark.me _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: <mar...@li...> - 2022-10-20 19:52:03
|
Hello, Found the bug and fixed it in https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 It is an AMAZING bug, triggered by an issue of precision loss. For those that enjoy this kind of things I will briefly describe what was happening. I used a tweaked floor() for speed. floor() function is supposed to return the largest integer value that is less than or equal to a number. My tweaked function was using mantissa tricks to run as fast as possible. It worked for all but a small number of combinations. Well, you hit one of those bad combinations. A number like 47.9993 (I think, I may be wrong on recalling the exact number). Quick floor of this particular number returned 48 when it really was 47. At the end its only 0.0007 difference so may seem harmless... BUT this was used for interpolation so a subtraction was involved. if we try to compute the node with that faulty floor and then subtract values to get the rest, we end in a negative number. And you know, negative number mixes bad with unsigned, so at the end this was creating a nasty out-of-bounds condition. Funny enough, very few numbers are capable of that. You were lucky enough to discover the bug because you hit a bad number with white with those profiles and flags otherwise this could go unnoticed for years. Many thanks for reporting. You earned the award of "bug of the year" because its rarity. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: L. E. Segovia <am...@am...> Sent: Thursday, October 20, 2022 3:46 AM To: mar...@li... Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi, The Krita code for the LCMS transform initialization is a nightmare... apart from a 10 y-o typo in the format definition (not declaring FLOAT_SH where we should), I've managed to consistently reproduce the bug. I've adjusted two lines below: > #include <lcms2.h> > #include <lcms2_fast_float.h> > > int main(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, > TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | > cmsFLAGS_HIGHRESPRECALC); > > float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f }; > float result[4] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } We at Krita use RGBA, and the given conversion flags: cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC. The pixel values were extracted straight from the exception stacktrace, and I've verified them separately. Best, amyspark On 19/10/2022 09:08, mar...@li... wrote: > > Hi, > > I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. > > int checkKrita(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, > TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); > > float ones[3] = { 1.0f, 1.0f, 1.0f }; > float result[3] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } > > BTW, are you linking the plug-in as a DLL? > > Regards > > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > -----Original Message----- > From: L. E. Segovia <am...@am...> > Sent: Wednesday, October 19, 2022 2:38 AM > To: Marti Maria <mar...@li...> > Cc: lcm...@li... > Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready > to be released > > Hey Marti, > > I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: > > lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, > const void * Input, void * Output, unsigned int PixelsPerLine, > unsigned int LineCount, const cmsStride * Stride) Line 199 > (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float > _tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * > InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 > (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) > > The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. > > Is there anything else I can do to help you reproduce it? > > Best, > > amyspark > > On 16/10/2022 16:40, Marti Maria wrote: >> Hello, >> >> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. >> >> Thanks >> Marti >> >> >>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >>> >>> Hey Marti, >>> >>> We've gotten a bug report at Krita regarding the fast float plugin: >>> >>> https://bugs.kde.org/show_bug.cgi?id=460512 >>> >>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >>> >>> Best, >>> >>> amyspark >>> >>> On 15/10/2022 15:38, Marti Maria wrote: >>>> I am glad to announce the imminent release of lcms2-2.14 The first >>>> release candidate is available here: >>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>>> Changes >>>> • lcms2 now fully implements ICC specification 4.4 >>>> • New multi-threaded plug-in >>>> • several fixes to keep fuzzers happy >>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>>> • Added more validation against broken profiles >>>> • Add more help to several tools >>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>>> Best regards >>>> Marti Maria >>>> The LittleCMS Project >>>> https://www.littlecms.com >>>> _______________________________________________ >>>> Lcms-user mailing list >>>> Lcm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> >>> -- >>> amyspark 🌸 https://www.amyspark.me >>> >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> > > -- > amyspark 🌸 https://www.amyspark.me > -- amyspark 🌸 https://www.amyspark.me |
|
From: L. E. S. <am...@am...> - 2022-10-20 01:53:09
|
Hi,
The Krita code for the LCMS transform initialization is a nightmare...
apart from a 10 y-o typo in the format definition (not declaring
FLOAT_SH where we should), I've managed to consistently reproduce the bug.
I've adjusted two lines below:
> #include <lcms2.h>
> #include <lcms2_fast_float.h>
>
> int main(void)
> {
> cmsHPROFILE hInput, hOutput;
> cmsHTRANSFORM xform;
>
> cmsPlugin(cmsFastFloatExtensions());
>
> hInput = cmsOpenProfileFromFile("profile.icc", "r");
> hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r");
>
> xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | cmsFLAGS_HIGHRESPRECALC);
>
> float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f };
> float result[4] = { 0 };
>
> cmsDoTransform(xform, ones, result, 1);
>
> cmsCloseProfile(hInput); cmsCloseProfile(hOutput);
> cmsDeleteTransform(xform);
> return 1;
> }
We at Krita use RGBA, and the given conversion flags:
cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC.
The pixel values were extracted straight from the exception stacktrace,
and I've verified them separately.
Best,
amyspark
On 19/10/2022 09:08, mar...@li... wrote:
>
> Hi,
>
> I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error.
>
> int checkKrita(void)
> {
> cmsHPROFILE hInput, hOutput;
> cmsHTRANSFORM xform;
>
> cmsPlugin(cmsFastFloatExtensions());
>
> hInput = cmsOpenProfileFromFile("profile.icc", "r");
> hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r");
>
> xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0);
>
> float ones[3] = { 1.0f, 1.0f, 1.0f };
> float result[3] = { 0 };
>
> cmsDoTransform(xform, ones, result, 1);
>
> cmsCloseProfile(hInput); cmsCloseProfile(hOutput);
> cmsDeleteTransform(xform);
> return 1;
> }
>
> BTW, are you linking the plug-in as a DLL?
>
> Regards
>
> Marti Maria
> The LittleCMS Project
> https://www.littlecms.com
>
> -----Original Message-----
> From: L. E. Segovia <am...@am...>
> Sent: Wednesday, October 19, 2022 2:38 AM
> To: Marti Maria <mar...@li...>
> Cc: lcm...@li...
> Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released
>
> Hey Marti,
>
> I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module:
>
> lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, const void * Input, void * Output, unsigned int PixelsPerLine, unsigned int LineCount, const cmsStride * Stride) Line 199
> (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float_tethra.c:199)
> lcms2.dll!cmsDoTransform(void * Transform, const void * InputBuffer, void * OutputBuffer, unsigned int Size) Line 207
> (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207)
>
> The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report.
>
> Is there anything else I can do to help you reproduce it?
>
> Best,
>
> amyspark
>
> On 16/10/2022 16:40, Marti Maria wrote:
>> Hello,
>>
>> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved.
>>
>> Thanks
>> Marti
>>
>>
>>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote:
>>>
>>> Hey Marti,
>>>
>>> We've gotten a bug report at Krita regarding the fast float plugin:
>>>
>>> https://bugs.kde.org/show_bug.cgi?id=460512
>>>
>>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it.
>>>
>>> Best,
>>>
>>> amyspark
>>>
>>> On 15/10/2022 15:38, Marti Maria wrote:
>>>> I am glad to announce the imminent release of lcms2-2.14 The first
>>>> release candidate is available here:
>>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1
>>>> Changes
>>>> • lcms2 now fully implements ICC specification 4.4
>>>> • New multi-threaded plug-in
>>>> • several fixes to keep fuzzers happy
>>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used
>>>> • Added more validation against broken profiles
>>>> • Add more help to several tools
>>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits.
>>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list.
>>>> Best regards
>>>> Marti Maria
>>>> The LittleCMS Project
>>>> https://www.littlecms.com
>>>> _______________________________________________
>>>> Lcms-user mailing list
>>>> Lcm...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/lcms-user
>>>
>>> --
>>> amyspark 🌸 https://www.amyspark.me
>>>
>>>
>>> _______________________________________________
>>> Lcms-user mailing list
>>> Lcm...@li...
>>> https://lists.sourceforge.net/lists/listinfo/lcms-user
>>
>
> --
> amyspark 🌸 https://www.amyspark.me
>
--
amyspark 🌸 https://www.amyspark.me
|
|
From: <mar...@li...> - 2022-10-19 13:04:19
|
Hi,
I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error.
int checkKrita(void)
{
cmsHPROFILE hInput, hOutput;
cmsHTRANSFORM xform;
cmsPlugin(cmsFastFloatExtensions());
hInput = cmsOpenProfileFromFile("profile.icc", "r");
hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r");
xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0);
float ones[3] = { 1.0f, 1.0f, 1.0f };
float result[3] = { 0 };
cmsDoTransform(xform, ones, result, 1);
cmsCloseProfile(hInput); cmsCloseProfile(hOutput);
cmsDeleteTransform(xform);
return 1;
}
BTW, are you linking the plug-in as a DLL?
Regards
Marti Maria
The LittleCMS Project
https://www.littlecms.com
-----Original Message-----
From: L. E. Segovia <am...@am...>
Sent: Wednesday, October 19, 2022 2:38 AM
To: Marti Maria <mar...@li...>
Cc: lcm...@li...
Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released
Hey Marti,
I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module:
lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, const void * Input, void * Output, unsigned int PixelsPerLine, unsigned int LineCount, const cmsStride * Stride) Line 199
(e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float_tethra.c:199)
lcms2.dll!cmsDoTransform(void * Transform, const void * InputBuffer, void * OutputBuffer, unsigned int Size) Line 207
(e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207)
The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report.
Is there anything else I can do to help you reproduce it?
Best,
amyspark
On 16/10/2022 16:40, Marti Maria wrote:
> Hello,
>
> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved.
>
> Thanks
> Marti
>
>
>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote:
>>
>> Hey Marti,
>>
>> We've gotten a bug report at Krita regarding the fast float plugin:
>>
>> https://bugs.kde.org/show_bug.cgi?id=460512
>>
>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it.
>>
>> Best,
>>
>> amyspark
>>
>> On 15/10/2022 15:38, Marti Maria wrote:
>>> I am glad to announce the imminent release of lcms2-2.14 The first
>>> release candidate is available here:
>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1
>>> Changes
>>> • lcms2 now fully implements ICC specification 4.4
>>> • New multi-threaded plug-in
>>> • several fixes to keep fuzzers happy
>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used
>>> • Added more validation against broken profiles
>>> • Add more help to several tools
>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits.
>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list.
>>> Best regards
>>> Marti Maria
>>> The LittleCMS Project
>>> https://www.littlecms.com
>>> _______________________________________________
>>> Lcms-user mailing list
>>> Lcm...@li...
>>> https://lists.sourceforge.net/lists/listinfo/lcms-user
>>
>> --
>> amyspark 🌸 https://www.amyspark.me
>>
>>
>> _______________________________________________
>> Lcms-user mailing list
>> Lcm...@li...
>> https://lists.sourceforge.net/lists/listinfo/lcms-user
>
--
amyspark 🌸 https://www.amyspark.me
|
|
From: L. E. S. <am...@am...> - 2022-10-19 00:47:16
|
Hey Marti, I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, const void * Input, void * Output, unsigned int PixelsPerLine, unsigned int LineCount, const cmsStride * Stride) Line 199 (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float_tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. Is there anything else I can do to help you reproduce it? Best, amyspark On 16/10/2022 16:40, Marti Maria wrote: > Hello, > > Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. > > Thanks > Marti > > >> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >> >> Hey Marti, >> >> We've gotten a bug report at Krita regarding the fast float plugin: >> >> https://bugs.kde.org/show_bug.cgi?id=460512 >> >> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >> >> Best, >> >> amyspark >> >> On 15/10/2022 15:38, Marti Maria wrote: >>> I am glad to announce the imminent release of lcms2-2.14 >>> The first release candidate is available here: >>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>> Changes >>> • lcms2 now fully implements ICC specification 4.4 >>> • New multi-threaded plug-in >>> • several fixes to keep fuzzers happy >>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>> • Added more validation against broken profiles >>> • Add more help to several tools >>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>> Best regards >>> Marti Maria >>> The LittleCMS Project >>> https://www.littlecms.com >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> >> -- >> amyspark 🌸 https://www.amyspark.me >> >> >> _______________________________________________ >> Lcms-user mailing list >> Lcm...@li... >> https://lists.sourceforge.net/lists/listinfo/lcms-user > -- amyspark 🌸 https://www.amyspark.me |
|
From: Marti M. <mar...@li...> - 2022-10-17 01:35:55
|
Hello, Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. Thanks Marti > On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: > > Hey Marti, > > We've gotten a bug report at Krita regarding the fast float plugin: > > https://bugs.kde.org/show_bug.cgi?id=460512 > > Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. > > Best, > > amyspark > > On 15/10/2022 15:38, Marti Maria wrote: >> I am glad to announce the imminent release of lcms2-2.14 >> The first release candidate is available here: >> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >> Changes >> • lcms2 now fully implements ICC specification 4.4 >> • New multi-threaded plug-in >> • several fixes to keep fuzzers happy >> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >> • Added more validation against broken profiles >> • Add more help to several tools >> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >> Best regards >> Marti Maria >> The LittleCMS Project >> https://www.littlecms.com >> _______________________________________________ >> Lcms-user mailing list >> Lcm...@li... >> https://lists.sourceforge.net/lists/listinfo/lcms-user > > -- > amyspark 🌸 https://www.amyspark.me > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: L. E. S. <am...@am...> - 2022-10-16 18:27:05
|
Hey Marti, We've gotten a bug report at Krita regarding the fast float plugin: https://bugs.kde.org/show_bug.cgi?id=460512 Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. Best, amyspark On 15/10/2022 15:38, Marti Maria wrote: > I am glad to announce the imminent release of lcms2-2.14 > > The first release candidate is available here: > > https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 > > Changes > > • lcms2 now fully implements ICC specification 4.4 > • New multi-threaded plug-in > • several fixes to keep fuzzers happy > • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used > • Added more validation against broken profiles > • Add more help to several tools > > ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. > > Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. > > > Best regards > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user -- amyspark 🌸 https://www.amyspark.me |
|
From: Marti M. <mar...@li...> - 2022-10-16 11:43:31
|
Hi, > Are there any plans for lcms to take advantage of the cicp tag to > determine colorspace, or will it just treat it as yet another bit of > metadata for the time being? I'm super stoked regardless of the > answer. Yes. for 2.14 just the metadata, for 2.15 some integration of the cicp tag to detect mismatches and avoid transforms on same profile on both sides. But this will take some time. Best regards Marti |
|
From: Wolthera <gri...@gm...> - 2022-10-16 10:01:20
|
Excellent!
On Sun, Oct 16, 2022 at 4:04 AM Marti Maria <mar...@li...> wrote:
>
> I am glad to announce the imminent release of lcms2-2.14
> [snip]
>
> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits.
>
> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list.
>
>
> Best regards
> Marti Maria
For people wondering, the changes are described in the 'Foreword' of
the ICC 4.4 spec, and they consist of some smaller fixes, improved
metadata features and most usefully the cicpTag, which is for storing
colorspace encoding metadata as defined by ITU H.273, which basically
defines some standard color spaces used in video broadcasting, and are
used for some screen-first formats like avif and heif. While we can
currently just create icc profiles or transform the data (rec 2100 can
be indicated by cicp but not represented in icc v4, so for Krita we
need to transform) as necessary, round tripping was less than ideal,
and being able to store some cicp data inside the profiles is going to
be super helpful!
Are there any plans for lcms to take advantage of the cicp tag to
determine colorspace, or will it just treat it as yet another bit of
metadata for the time being? I'm super stoked regardless of the
answer.
The new threading plugin looks cool too, I imagine it's going to be a
lot of help for people newly integrating lcms!
--
Wolthera
|
|
From: Marti M. <mar...@li...> - 2022-10-16 02:03:14
|
I am glad to announce the imminent release of lcms2-2.14 The first release candidate is available here: https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 Changes • lcms2 now fully implements ICC specification 4.4 • New multi-threaded plug-in • several fixes to keep fuzzers happy • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used • Added more validation against broken profiles • Add more help to several tools ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com |