lcms-user Mailing List for Little cms color engine (Page 16)
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
|
Nov
|
Dec
|
From: Noel C. <NCa...@Pr...> - 2017-02-20 17:34:52
|
Oh, and one more thing I meant to mention... A tone curve with a pure 2.2 gamma function is very different than an sRGB tone curve where it really counts - down in the small values (near black). Just thought I'd throw that out there as food for thought. -Noel |
From: Noel C. <NCa...@Pr...> - 2017-02-20 17:20:54
|
> For other formats, such as PNG, I would need to transform. I believe a PNG file can carry a color profile tag, but there are certainly formats that can't. Not to belabor this, but does your design specify what color space the data will be in if it saved in an image file format that does not carry a profile tag? There is no standard for what color space untagged images should be stored in. Because of the mix of computers in the world and the things that have been done in the past, you might meet expectations more of the time if you were save color images in the sRGB IEC61966-2.1 color space. Windows has been described as embracing "sRGB by default", for example. But that's up to you. If you are anticipating prompting the user for target color space information, then that could resolve the problem. -Noel From: Aaron Boxer [mailto:bo...@gm...] Sent: Mon, February 20, 2017 12:02 PM To: Noel Carboni Cc: lcm...@li... Subject: Re: [Lcms-user] Apply profile with PCS = cmsSigXYZData, Color Space = cmsSigGrayData Thanks, Noel. That is a good point. For TIFF, I can store the profile in the TIFF file, and avoid transforming. For other formats, such as PNG, I would need to transform. On Mon, Feb 20, 2017 at 11:49 AM, Noel Carboni <NCa...@pr...> wrote: > Thanks, Noel. This is not for display on monitor. JPEG 2000 supports embedded ICC profiles, and I am > trying to use the profile when decoding the image. I guess I'm still not clear: Why are you transforming the data into another color space? If you're trying to decode it then save it as another kind of file (e.g., .tiff or .jpg or something that can carry its own color profile tag), maybe you should consider just maintaining the color profile it's already got. What I'm saying is that maybe you just want to decode the data, then save the data in another file, and tag that file with the same profile the JPEG2000 file started with, making no color transformation on the decoded data at all. LittleCMS need not be involved with that. As Marti mentioned, if you DO want to transform the color values into a different color space, you need to specify what that color space is. -Noel |
From: Martí M. <mar...@li...> - 2017-02-20 17:05:05
|
Hi, I just C&P from testbed, sorry. A portable function should be like this: static cmsHPROFILE Create_Gray22(void) { cmsHPROFILE hProfile; cmsToneCurve* Curve = cmsBuildGamma(0, 2.2); if (Curve == NULL) return NULL; hProfile = cmsCreateGrayProfileTHR(0, cmsD50_xyY(), Curve); cmsFreeToneCurve(Curve); return hProfile; } Regards Marti > > On 20/02/2017 17:33, Aaron Boxer wrote: >> Thanks, Marti. Is the white point and transfer function not already >> specified in the profile? Pardon my ignorance, >> not that familiar with colour transforms. >> >> On Mon, Feb 20, 2017 at 11:28 AM, Martí Maria >> <mar...@li... <mailto:mar...@li...>> wrote: >> >> >> Hi, >> >> You need to specify white point and transfer function to >> cmsCreateGrayProfile(), see manual page 28 >> >> Regards >> >> Marti >> >> On 20/02/2017 7:04, Aaron Boxer wrote: >>> Hello, >>> >>> I have a jpeg 2000 file with an ICC profile. >>> >>> PCS is cmsSigXYZData and color space is cmsSigGrayData. >>> >>> The file can be found here: >>> https://github.com/GrokImageCompression/grok/issues/38 >>> <https://github.com/GrokImageCompression/grok/issues/38> >>> >>> I am working on a library that decodes the jpeg 2000 file and >>> applies the ICC profile, using LCMS. >>> >>> Currently, I have this code: >>> >>> in_type = TYPE_GRAY_8; >>> out_type = TYPE_RGB_8; >>> out_prof = cmsCreate_sRGBProfile(); >>> >>> and I can create the transform and apply the ICC profile, but >>> the output is an RGB file. >>> What I would like is to output a grayscale file. >>> >>> So, if I instead call >>> >>> out_prof = cmsCreateGrayProfile(NULL,NULL); >>> >>> then cmsCreateTransform returns NULL and I can't apply the profile. >>> >>> >>> What is the best way of creating a transform for this kind of >>> grayscale image ? >>> >>> Thanks so much, >>> Aaron >>> >>> >>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, SlashDot.org!http://sdm.link/slashdot >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> <mailto:Lcm...@li...> >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> <https://lists.sourceforge.net/lists/listinfo/lcms-user> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >> _______________________________________________ Lcms-user mailing >> list Lcm...@li... >> <mailto:Lcm...@li...> >> https://lists.sourceforge.net/lists/listinfo/lcms-user >> <https://lists.sourceforge.net/lists/listinfo/lcms-user> >> > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: Aaron B. <bo...@gm...> - 2017-02-20 17:02:56
|
On Mon, Feb 20, 2017 at 11:56 AM, Martí Maria <mar...@li...> wrote: > > Hi, > >Thanks, Marti. Is the white point and transfer function not already > specified in the profile? Pardon my ignorance, > >not that familiar with colour transforms. > > > No worries, if you use a real profile, yes, it is included in the profile. > If you use a built-in profile, that is a template to generate profiles, so > you need parameters. > May I ask what you mean by "real profile" ? Thanks for the code below, I will try it out, but would the original profile contain information on gamma and white point ? Thanks, Aaron > Try this: > // A gamma-2.2 gray space > static > cmsHPROFILE Create_Gray22(void) > { > cmsHPROFILE hProfile; > cmsToneCurve* Curve = cmsBuildGamma(DbgThread(), 2.2); > if (Curve == NULL) return NULL; > > hProfile = cmsCreateGrayProfileTHR(DbgThread(), cmsD50_xyY(), Curve); > cmsFreeToneCurve(Curve); > > return hProfile; > } > > Regards > > Marti > > > On 20/02/2017 17:33, Aaron Boxer wrote: > > Thanks, Marti. Is the white point and transfer function not already > specified in the profile? Pardon my ignorance, > not that familiar with colour transforms. > > On Mon, Feb 20, 2017 at 11:28 AM, Martí Maria <mar...@li...> > wrote: > >> >> Hi, >> >> You need to specify white point and transfer function to >> cmsCreateGrayProfile(), see manual page 28 >> >> Regards >> >> Marti >> On 20/02/2017 7:04, Aaron Boxer wrote: >> >> Hello, >> >> I have a jpeg 2000 file with an ICC profile. >> >> PCS is cmsSigXYZData and color space is cmsSigGrayData. >> >> The file can be found here: https://github.com/GrokImageCo >> mpression/grok/issues/38 >> >> I am working on a library that decodes the jpeg 2000 file and applies the >> ICC profile, using LCMS. >> >> Currently, I have this code: >> >> in_type = TYPE_GRAY_8; >> out_type = TYPE_RGB_8; >> out_prof = cmsCreate_sRGBProfile(); >> >> and I can create the transform and apply the ICC profile, but the output >> is an RGB file. >> What I would like is to output a grayscale file. >> >> So, if I instead call >> >> out_prof = cmsCreateGrayProfile(NULL,NULL); >> >> then cmsCreateTransform returns NULL and I can't apply the profile. >> >> >> What is the best way of creating a transform for this kind of grayscale >> image ? >> >> Thanks so much, >> Aaron >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >> >> _______________________________________________ >> Lcms-user mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/lcms-user >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most engaging >> tech sites, SlashDot.org! http://sdm.link/slashdot >> _______________________________________________ Lcms-user mailing list >> Lcm...@li... https://lists.sourceforge.net/ >> lists/listinfo/lcms-user > > |
From: Aaron B. <bo...@gm...> - 2017-02-20 17:01:46
|
Thanks, Noel. That is a good point. For TIFF, I can store the profile in the TIFF file, and avoid transforming. For other formats, such as PNG, I would need to transform. On Mon, Feb 20, 2017 at 11:49 AM, Noel Carboni < NCa...@pr...> wrote: > > Thanks, Noel. This is not for display on monitor. JPEG 2000 supports > embedded ICC profiles, and I am > > > trying to use the profile when decoding the image. > > > > I guess I'm still not clear: Why are you transforming the data into > another color space? > > > > If you're trying to decode it then save it as another kind of file (e.g., > .tiff or .jpg or something that can carry its own color profile tag), maybe > you should consider just maintaining the color profile it's already got. > > > > What I'm saying is that maybe you just want to decode the data, then save > the data in another file, and tag that file with the same profile the > JPEG2000 file started with, making no color transformation on the decoded > data at all. LittleCMS need not be involved with that. > > > > As Marti mentioned, if you DO want to transform the color values into a > different color space, you need to specify what that color space is. > > > > -Noel > > > |
From: Martí M. <mar...@li...> - 2017-02-20 16:56:32
|
Hi, >Thanks, Marti. Is the white point and transfer function not already specified in the profile? Pardon my ignorance, >not that familiar with colour transforms. No worries, if you use a real profile, yes, it is included in the profile. If you use a built-in profile, that is a template to generate profiles, so you need parameters. Try this: // A gamma-2.2 gray space static cmsHPROFILE Create_Gray22(void) { cmsHPROFILE hProfile; cmsToneCurve* Curve = cmsBuildGamma(DbgThread(), 2.2); if (Curve == NULL) return NULL; hProfile = cmsCreateGrayProfileTHR(DbgThread(), cmsD50_xyY(), Curve); cmsFreeToneCurve(Curve); return hProfile; } Regards Marti On 20/02/2017 17:33, Aaron Boxer wrote: > Thanks, Marti. Is the white point and transfer function not already > specified in the profile? Pardon my ignorance, > not that familiar with colour transforms. > > On Mon, Feb 20, 2017 at 11:28 AM, Martí Maria > <mar...@li... <mailto:mar...@li...>> wrote: > > > Hi, > > You need to specify white point and transfer function to > cmsCreateGrayProfile(), see manual page 28 > > Regards > > Marti > > On 20/02/2017 7:04, Aaron Boxer wrote: >> Hello, >> >> I have a jpeg 2000 file with an ICC profile. >> >> PCS is cmsSigXYZData and color space is cmsSigGrayData. >> >> The file can be found here: >> https://github.com/GrokImageCompression/grok/issues/38 >> <https://github.com/GrokImageCompression/grok/issues/38> >> >> I am working on a library that decodes the jpeg 2000 file and >> applies the ICC profile, using LCMS. >> >> Currently, I have this code: >> >> in_type = TYPE_GRAY_8; >> out_type = TYPE_RGB_8; >> out_prof = cmsCreate_sRGBProfile(); >> >> and I can create the transform and apply the ICC profile, but the >> output is an RGB file. >> What I would like is to output a grayscale file. >> >> So, if I instead call >> >> out_prof = cmsCreateGrayProfile(NULL,NULL); >> >> then cmsCreateTransform returns NULL and I can't apply the profile. >> >> >> What is the best way of creating a transform for this kind of >> grayscale image ? >> >> Thanks so much, >> Aaron >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org!http://sdm.link/slashdot >> >> _______________________________________________ >> Lcms-user mailing list >> Lcm...@li... >> <mailto:Lcm...@li...> >> https://lists.sourceforge.net/lists/listinfo/lcms-user >> <https://lists.sourceforge.net/lists/listinfo/lcms-user> > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ Lcms-user mailing > list Lcm...@li... > <mailto:Lcm...@li...> > https://lists.sourceforge.net/lists/listinfo/lcms-user > <https://lists.sourceforge.net/lists/listinfo/lcms-user> > |
From: Noel C. <NCa...@Pr...> - 2017-02-20 16:49:57
|
> Thanks, Noel. This is not for display on monitor. JPEG 2000 supports embedded ICC profiles, and I am > trying to use the profile when decoding the image. I guess I'm still not clear: Why are you transforming the data into another color space? If you're trying to decode it then save it as another kind of file (e.g., .tiff or .jpg or something that can carry its own color profile tag), maybe you should consider just maintaining the color profile it's already got. What I'm saying is that maybe you just want to decode the data, then save the data in another file, and tag that file with the same profile the JPEG2000 file started with, making no color transformation on the decoded data at all. LittleCMS need not be involved with that. As Marti mentioned, if you DO want to transform the color values into a different color space, you need to specify what that color space is. -Noel |
From: Aaron B. <bo...@gm...> - 2017-02-20 16:35:04
|
Thanks, Noel. This is not for display on monitor. JPEG 2000 supports embedded ICC profiles, and I am trying to use the profile when decoding the image. On Mon, Feb 20, 2017 at 11:23 AM, Noel Carboni < NCa...@pr...> wrote: > Hi Aaron, > > > > What do you mean by "applies the ICC profile"? Are you trying to convert > the image to be displayed accurately on a monitor? > > > > If so, wouldn't you want the output type to be RGB and use the monitor's > profile as the output profile? > > > > Perhaps I'm not understanding at all what you're trying to accomplish. > > > > -Noel > > > > > > *From:* Aaron Boxer [mailto:bo...@gm...] > *Sent:* Mon, February 20, 2017 1:04 AM > *To:* lcm...@li... > *Subject:* [Lcms-user] Apply profile with PCS = cmsSigXYZData, Color > Space = cmsSigGrayData > > > > Hello, > > > I have a jpeg 2000 file with an ICC profile. > > PCS is cmsSigXYZData and color space is cmsSigGrayData. > > The file can be found here: https://github.com/GrokImageCompression/grok/ > issues/38 > > I am working on a library that decodes the jpeg 2000 file and applies the > ICC profile, using LCMS. > > Currently, I have this code: > > in_type = TYPE_GRAY_8; > out_type = TYPE_RGB_8; > out_prof = cmsCreate_sRGBProfile(); > > and I can create the transform and apply the ICC profile, but the output > is an RGB file. > What I would like is to output a grayscale file. > > So, if I instead call > > out_prof = cmsCreateGrayProfile(NULL,NULL); > > then cmsCreateTransform returns NULL and I can't apply the profile. > > What is the best way of creating a transform for this kind of grayscale > image ? > > Thanks so much, > > Aaron > > > > > > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user > > |
From: Martí M. <mar...@li...> - 2017-02-20 16:29:05
|
Hi, You need to specify white point and transfer function to cmsCreateGrayProfile(), see manual page 28 Regards Marti On 20/02/2017 7:04, Aaron Boxer wrote: > Hello, > > I have a jpeg 2000 file with an ICC profile. > > PCS is cmsSigXYZData and color space is cmsSigGrayData. > > The file can be found here: > https://github.com/GrokImageCompression/grok/issues/38 > > I am working on a library that decodes the jpeg 2000 file and applies > the ICC profile, using LCMS. > > Currently, I have this code: > > in_type = TYPE_GRAY_8; > out_type = TYPE_RGB_8; > out_prof = cmsCreate_sRGBProfile(); > > and I can create the transform and apply the ICC profile, but the > output is an RGB file. > What I would like is to output a grayscale file. > > So, if I instead call > > out_prof = cmsCreateGrayProfile(NULL,NULL); > > then cmsCreateTransform returns NULL and I can't apply the profile. > > > What is the best way of creating a transform for this kind of > grayscale image ? > > Thanks so much, > Aaron > > > > > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: Noel C. <NCa...@Pr...> - 2017-02-20 16:23:12
|
Hi Aaron, What do you mean by "applies the ICC profile"? Are you trying to convert the image to be displayed accurately on a monitor? If so, wouldn't you want the output type to be RGB and use the monitor's profile as the output profile? Perhaps I'm not understanding at all what you're trying to accomplish. -Noel From: Aaron Boxer [mailto:bo...@gm...] Sent: Mon, February 20, 2017 1:04 AM To: lcm...@li... Subject: [Lcms-user] Apply profile with PCS = cmsSigXYZData, Color Space = cmsSigGrayData Hello, I have a jpeg 2000 file with an ICC profile. PCS is cmsSigXYZData and color space is cmsSigGrayData. The file can be found here: https://github.com/GrokImageCompression/grok/issues/38 I am working on a library that decodes the jpeg 2000 file and applies the ICC profile, using LCMS. Currently, I have this code: in_type = TYPE_GRAY_8; out_type = TYPE_RGB_8; out_prof = cmsCreate_sRGBProfile(); and I can create the transform and apply the ICC profile, but the output is an RGB file. What I would like is to output a grayscale file. So, if I instead call out_prof = cmsCreateGrayProfile(NULL,NULL); then cmsCreateTransform returns NULL and I can't apply the profile. What is the best way of creating a transform for this kind of grayscale image ? Thanks so much, Aaron |
From: Aaron B. <bo...@gm...> - 2017-02-20 06:04:37
|
Hello, I have a jpeg 2000 file with an ICC profile. PCS is cmsSigXYZData and color space is cmsSigGrayData. The file can be found here: https://github.com/GrokImageCompression/grok/issues/38 I am working on a library that decodes the jpeg 2000 file and applies the ICC profile, using LCMS. Currently, I have this code: in_type = TYPE_GRAY_8; out_type = TYPE_RGB_8; out_prof = cmsCreate_sRGBProfile(); and I can create the transform and apply the ICC profile, but the output is an RGB file. What I would like is to output a grayscale file. So, if I instead call out_prof = cmsCreateGrayProfile(NULL,NULL); then cmsCreateTransform returns NULL and I can't apply the profile. What is the best way of creating a transform for this kind of grayscale image ? Thanks so much, Aaron |
From: Roger B. <gr...@vi...> - 2017-02-08 01:31:27
|
Found the solution!!!! Thank you all. Best / Roger -----Original Message----- From: Roger Breton [mailto:gr...@vi...] Sent: Tuesday, February 7, 2017 6:43 PM To: 'lcm...@li...' <lcm...@li...> Subject: RE: Lcms-user Digest, Vol 111, Issue 5 Looking for help with accessing the cmsTempFromWhitePoint() function from C#. My import statement is as follows: [DllImport(@lcms2Path)] public static extern bool cmsTempFromWhitePoint(IntPtr TempK, IntPtr WhitePoint) The WhitePoint CIE xyY is declared this way: [StructLayout(LayoutKind.Sequential)] public struct cmsCIExyY { public double x; public double y; public double Y; }; I create variable to hold CIExyY structure this way: cmsCIExyY CIExyY; My function call looks like this: IntPtr TempK = IntPtr.Zero; IntPtr unmanagedAddr = Marshal.AllocHGlobal(Marshal.SizeOf(CIExyY)); // Allocate unmanaged memory Marshal.StructureToPtr(CIExyY, unmanagedAddr, true); // marshall the structure to the memory bool Result = cmsTempFromWhitePoint(tempK, unmanagedAddr); But I get "Assertion failed" when executing the call: (TempK != ((void *)0)) I am confident in my code to marshall the CIExyY structure from managed to unmanaged memory. But I have no clue how to approach the TempK pointer? I think the error says "Wrong type of Pointer" was supplied. Best / Roger |
From: Roger B. <gr...@vi...> - 2017-02-07 23:43:36
|
Looking for help with accessing the cmsTempFromWhitePoint() function from C#. My import statement is as follows: [DllImport(@lcms2Path)] public static extern bool cmsTempFromWhitePoint(IntPtr TempK, IntPtr WhitePoint) The WhitePoint CIE xyY is declared this way: [StructLayout(LayoutKind.Sequential)] public struct cmsCIExyY { public double x; public double y; public double Y; }; I create variable to hold CIExyY structure this way: cmsCIExyY CIExyY; My function call looks like this: IntPtr TempK = IntPtr.Zero; IntPtr unmanagedAddr = Marshal.AllocHGlobal(Marshal.SizeOf(CIExyY)); // Allocate unmanaged memory Marshal.StructureToPtr(CIExyY, unmanagedAddr, true); // marshall the structure to the memory bool Result = cmsTempFromWhitePoint(tempK, unmanagedAddr); But I get "Assertion failed" when executing the call: (TempK != ((void *)0)) I am confident in my code to marshall the CIExyY structure from managed to unmanaged memory. But I have no clue how to approach the TempK pointer? I think the error says "Wrong type of Pointer" was supplied. Best / Roger |
From: Roger B. <gr...@vi...> - 2017-02-04 17:21:25
|
Eureka! 1) Create a new cmsCIEXYZ structure this way: CIE_XYZ MyXYZ; 2) Populate its members with test values: MyXYZ.CIE_X = 0.9666; MyXYZ.CIE_Y = 1.0; MyXYZ.CIE_Z = 0.8555; 3) Create boolean variable for cmsWriteTag return code: bool Result; 4) Allocate unmanaged memory for MyXYZ: IntPtr Pointer = Marshal.AllocHGlobal(Marshal.SizeOf(MyXYZ)); 5) Ask CLR to "move" the data from managed memory to unmanaged memory: Marshal.StructureToPtr(MyXYZ, Pointer, true); 6) I execute the call to cmsWriteTag: Result = cmsWriteTag(hProfiler, 0x77747074, Pointer); 7) The call succeeded! I got "Result = true"! 8) To test the change in XYZ values, I make a new call to cmsReadTag: IntPtr Pointer = IntPtr.Zero; Pointer = NativeMethods.cmsReadTag(hProfile, 0x77747074); MyXYZ MediaWhitePoint = (MyCIEXYZ)Marshal.PtrToStructure(Pointer, typeof(MyCIEXYZ)); 9) And voilà! These are the new XYZ values!!!! // X = 0.9666 // Y = 1.0 // Z = 0.8555 10) I love programming with LittleCMS -- thank YOU Marti Maria!!!! I still have a TON of questions... Once I modified the monitor profile, is there a way to "Save As"? Save the profile under a new name? / Roger Breton |
From: Roger B. <gr...@vi...> - 2017-02-04 14:39:15
|
I'm stuck in cmsWriteTag now. :( / Roger |
From: Roger B. <gr...@vi...> - 2017-02-03 22:11:05
|
Got the "Retrieve" part!!! IntPtr Pointer = IntPtr.Zero; Pointer = cmsReadTag(hProfiler, 0x77747074); // MediaWhitePointTag MyCIEXYZ MediaWhitePoint = (MyCIEXYZ)Marshal.PtrToStructure(Pointeur, typeof(MyCIEXYZ)); That's it!!!! And this is the beautiful data I received!!!! // X = 0.964202880859375 // Y = 0.9999847412109375 // Z = 0.8251953125 I could kiss my monitor ;-) Now, I have to figure out how to "Write" the data out to the profile. My initial code looks like this: [DllImport(@lcms2Path)] public static extern bool cmsWriteTag(IntPtr hProfile, uint cmsTagSignature, IntPtr Data); I have to figure out how to pass a pointer to structure the cmsWriteTag??? Wish good luck ;-) / Roger Breton |
From: Roger B. <gr...@vi...> - 2017-02-03 20:12:56
|
Marti suggested to use the cmsReadTad and cmsWriteTag -- good idea! This is proving a little difficult, however, in C#, given my humble level of system programming. So far, I have declared the call this way: [DllImport(@lcms2Path)] public static extern IntPtr cmsReadTag(IntPtr hProfile, uint cmsTagSignature); (Table 21 does not specify the type of cmsTagSignature so I am inferring Unsigned Integer, 32bits, type) Then, in my code, I call the function this way: IntPtr Pointer = IntPtr.Zero; Pointer = cmsReadTag (hDestination, 0x77747074); // 0x77747074 = MediaWhitePointTag I have not run that code YET but I assume it will run fine, up to this point, which is where I have to access the memory area pointed to by "Pointer"? My CIEXYZ structure, to hold the data, is declared this way: public struct MyCIEXYZ { public double X; // cmsFloat64Number, public double Y; // MS says double type = 64bit double precision IEEE 754 format ? public double Z; // is it OK to use double? } Then, I create an instance of myCIEXYZ this way, after receiving the Pointer from cmsReadTag: MyCIEXYZ MediaWhitePoint; The problem is that, beyond this point, I have no idea how to access the parsed data using the returned Pointer in C#? It gets complicated. There is the business of "declaring" UnsafeCode and, possibly, "pinning" area of memory. I would appreciate some guidance, if possible. Keep in mind that, later, I am going to have to find a way to send my modified CIE XYZ data *to* the profile, through the cmsWrite() function! This is going to be interesting... I will continue my research on my own but, in the meantime, any help is appreciated. / Roger Breton ------------------------------ just use cmsReadTag and cmsWriteTag. Please note white point only affects absolute colorimetric intent. Regards Marti |
From: Martí M. <mar...@li...> - 2017-02-03 08:16:06
|
Thomas, I have accepted the pull request. Thanks for this great contribution! Regards Marti On 02/02/2017 14:59, Thomas Weber wrote: > On Sun, Jan 29, 2017 at 09:23:36PM +0100, Martí Maria wrote: >> The standard distribution does not include that because it is supposed to be >> C99 portable, though it seems almost everyone is using either VS or gcc and >> compatibles like Intel's icc. I was evaluating the possibility of including >> this in a conditional define, but it has implications. For example in the >> the testbed, as you have already discovered. So for now is not in the to do >> list. > I have sent you a pull request that implements the hiding of symbols. > For non-supporting compilers, nothing should change. Although I was > unable to test this, as both Clang and GCC support the flag for quite > some time and I have no other compilers available. > > Thomas > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user > |
From: Martí M. <mar...@li...> - 2017-02-03 08:14:54
|
Hi Roger, just use cmsReadTag and cmsWriteTag. Please note white point only affects absolute colorimetric intent. Regards Marti On 03/02/2017 2:02, Roger Breton wrote: > Is there any way, any tools, any API, to edit the White Point of an ICC > profile within LittleCMS? > > > > I would like to be able to interactively edit the white point editing of a > monitor profile. > > I know this is very advanced :) > > > > Best / Roger > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: Roger B. <gr...@vi...> - 2017-02-03 01:02:15
|
Is there any way, any tools, any API, to edit the White Point of an ICC profile within LittleCMS? I would like to be able to interactively edit the white point editing of a monitor profile. I know this is very advanced :) Best / Roger |
From: Thomas W. <tw...@de...> - 2017-02-02 13:59:44
|
On Sun, Jan 29, 2017 at 09:23:36PM +0100, Martí Maria wrote: > The standard distribution does not include that because it is supposed to be > C99 portable, though it seems almost everyone is using either VS or gcc and > compatibles like Intel's icc. I was evaluating the possibility of including > this in a conditional define, but it has implications. For example in the > the testbed, as you have already discovered. So for now is not in the to do > list. I have sent you a pull request that implements the hiding of symbols. For non-supporting compilers, nothing should change. Although I was unable to test this, as both Clang and GCC support the flag for quite some time and I have no other compilers available. Thomas |
From: Martí M. <mar...@li...> - 2017-01-29 20:23:37
|
Hello Thomas, A macro takes care of this, CMSAPI. For gcc you may want to change lcms2.h line 239 to this: #define CMSAPI __attribute__((visibility("protected"))) Windows uses some similar: define CMSAPI __declspec(dllexport) The standard distribution does not include that because it is supposed to be C99 portable, though it seems almost everyone is using either VS or gcc and compatibles like Intel's icc. I was evaluating the possibility of including this in a conditional define, but it has implications. For example in the the testbed, as you have already discovered. So for now is not in the to do list. The testsuite is a special program, not a "real" .so client. Its purpose is to validate the platform, it can be checked with the static library only, for example. Regards Marti On 29/01/2017 16:06, Thomas Weber wrote: > Hi, > > I am trying to change the autoconf build system such that > functions/symbols from lcms2_internal.h are no longer exported in the > shared library, similar to the Windows build. This has progressed fine > so far, but the testsuite uses several of these functions (see attached > diff). If they are no longer publicly available in the shared library, > testbed/testcms cannot be built. > > How is the Windows build working around this? > > Thanks > Thomas > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: Thomas W. <tw...@de...> - 2017-01-29 17:28:25
|
Hi, I am trying to change the autoconf build system such that functions/symbols from lcms2_internal.h are no longer exported in the shared library, similar to the Windows build. This has progressed fine so far, but the testsuite uses several of these functions (see attached diff). If they are no longer publicly available in the shared library, testbed/testcms cannot be built. How is the Windows build working around this? Thanks Thomas |
From: Roger B. <gr...@vi...> - 2017-01-15 18:52:24
|
Found the "bug" in my code. It's complicated thinking of everything ;-) Thank's! / Roger ------------------------------ Message: 2 Date: Sat, 14 Jan 2017 16:14:03 -0500 From: "Roger Breton" <gr...@vi...> Subject: [Lcms-user] Bug in Lcms2.dll To: <lcm...@li...> Message-ID: <00ae01d26eab$22cb56a0$686203e0$@videotron.ca> Content-Type: text/plain; charset="US-ASCII" I am running into a "new" bug under Visual Studio 2013. I am getting a Microsoft Visual C++ Runtime Library Assertion failed error. Program: c:\lcms2.dll File: c:\users\.....\documents\visual studio 2013\p...\cmsio0.c Line 372 Expression: (Filename != ((void *)0) Any help is appreciated. / Roger Breton |
From: Roger B. <gr...@vi...> - 2017-01-14 21:29:17
|
I am running into a "new" bug under Visual Studio 2013. I am getting a Microsoft Visual C++ Runtime Library Assertion failed error. Program: c:\lcms2.dll File: c:\users\.....\documents\visual studio 2013\p...\cmsio0.c Line 372 Expression: (Filename != ((void *)0) Any help is appreciated. / Roger Breton |