tag:blogger.com,1999:blog-54132634857922412024-03-27T06:08:18.911+00:00LittleCMS 2This small blog is supposed to be a way to drop my thoughts, findings, errors and caveats about the development of version two of the littlecms color management engine.
http://www.littlecms.comMarti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.comBlogger55125tag:blogger.com,1999:blog-5413263485792241.post-1438703096049890402013-06-30T15:43:00.001+01:002013-06-30T15:43:11.153+01:00LittleCMS 2.5 released<div class="post-header">
</div>
I am glad to the announce the release 2.5 of the LittleCMS open source color engine.<br />
<br />
Version 2.5 is a maintenance release focused on the error handling and non-happy path, implements the black point compensation algorithm as disclosed by the ICC and adresses several minor issues.<br />
<br />
See the changelog for further details.<br />
<a href="http://www.littlecms.com/download.html">http://www.littlecms.com/download.html</a>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com320tag:blogger.com,1999:blog-5413263485792241.post-8860139692107325442012-07-28T16:00:00.002+01:002012-07-28T16:02:21.466+01:00Why when I convert from linear space I got dark shadows posterization?This question has been raised a number of times across the years. The first time I faced it was with JDK incorporating lcms1. They had a test profile that was somehow giving bad results when optimized. After close inspection, the profile was found to be operating in linear XYZ space. The complaint was almost the same: when I use linear space as input, optimization doesn’t work. Otherwise, all other combinations are ok. And this seems to be also the actual case; all other combinations are working fine. Try for example to reverse the transform going from regular sRGB to your linear space, you will find all the issue are now gone.<br />
<br />
But anyway, there is this case that seems to fail. And that’s true: on this particular case, some dark shadows got a dE > 1.5 if using the default settings. Fine, it happens that for this extreme case, the defaults don’t work. This is the reason why there is called “default” and there is a setting to control it.<br />
<br />
So, the short answer is: don’t optimize when using a linear XYZ space as input in 16 bits transforms.<br />
<br />
But I guess you want also the long answer. So, here you go. <br />
<br />
When you use lcms to create a color transform joining two or more profiles, you are creating a devicelink profile. You don’t see it as a file; it lives in memory, and is destroyed when you delete the transform. But it is there.<br />
<br />
Devicelinks can be implemented in different ways, for example they can be implemented as a set of curves, or by a matrix, or by a 3D CLUT table, or by a combination of all elements above. Some of those ways are better than others in terms of xput, others are better in terms of image quality. CMMs have to “guess” which is the best combination of elements for a given set of profiles. There is balance between quality and performance. For some corner cases, optimizing for speed can effectively introduce defects on quality. <br />
<br />
The best devicelink representation often depends on the true nature of the space described by the profiles. Specially the input space, But then… the profile only gives you a way to convert form/to Lab to its space, and gives no other clue about the space nature. <br />
<br />
An example of ill-formed spaces are those that are operating in linear XYZ gamma space. You should NEVER user linear gamma to store your 8-bit images. Why? Because in 8 bits you have 256 levels, and in linear gamma the separation between those levels is not perceptually uniform. That means you have very few levels to encode the effective dynamic range of your image and many levels are wasted in highlights. Hold on, you would say, RAW images are encoded in linear gamma and they work quite well, isn’t it? You are right… but I said 8 bits, remember? If you move to 16 bits or floating point, you can still use linear encoding, but with some care.<br />
<br />
Back to our methods to encode devicelinks. One used by lcms when the transform converts form 16 bits to 16 bits, is a CLUT table. This is just a 3D (or 4D in CMYK) grid with nodes. Pixel values are interpolated across nodes. For example, the distortion you get when going from sRGB to AdobeRGB is stored in a 3D grid of 17 nodes on each R, G, B side. When a pixel arrives, the corresponding nodes that enclose the value are selected and the result is interpolated. In our 17 node example, a value of, say, (100, 100, 100) will go on the 100*(17-1)/255 = 6.7 so the nodes 6 and 7 of each side will be taken for interpolation. <br />
<br />
Le’s now take a linear space. Since as said, many colors are collapsed to a relatively few codes due to the gamma encoding, almost all dynamic range is confined to few nodes. That mean In a 17 nodes grid, most image dynamic range will fall in 5 or 6 nodes. And this is the reason you got posterization in shadows: most of dark tones falls in just 1-2 nodes and linear interpolation cannot deal with the non-linear nature of the transform linear-gamma 2.2.<br />
<br />
How to solve this? The most evident way is to not use 3D CLUT optimization. The CMM already does that if you use floating point, or if you use 8 bits. In lcms2.03 there is some experimental flag that tries to solve this issue adding an extra tone curve cmsFLAGS_CLUT_POST_LINEARIZATION and cmsFLAGS_CLUT_PRE_LINEARIZATION. I have checked that and found to solve this issue as well.<br />
<br />
So, that is the reason why you only see this issue when converting from 16 bits to 16 bits with default flags. Placing a NOOPTIMIZE in all transforms would prevent problems, but at big performance penalty that is hard to explain just to fix this specific case. It is like you have a Ferrari but you go always at 25Mph just because once upon a time you faced a winding road. <br />
<br />
My recommendation for programmers would be to allow end user to turn optimization off for general usage, or at least to provide a specialized workflow for RAW handling with optimizations turned off, that is the only place when linear XYZ makes sense. For users, I would recommend to NEVER use linear XYZ spaces. They are good for nothing, nor for storage, nor for image processing. The very few algorithms that need to be done in linear can do and undo the conversion when processing. But anyway, there are people with strong opinions on this field and everybody is free to do whatever they want. This is just a recommendation, please don’t take it as a stone-engraved truth.<br />
<br />Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com29tag:blogger.com,1999:blog-5413263485792241.post-89399953087723825082012-07-28T15:58:00.002+01:002012-07-28T15:58:32.339+01:00Hi and howdy!<br />
<br />
After so much time I'm retaking this blog becuase release date of 2.4 is getting near. The new release has many improvements and maybe it would be interesting to comment those in detail. Stay tuned!Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com228tag:blogger.com,1999:blog-5413263485792241.post-79562766065059190602011-12-16T09:54:00.000+00:002011-12-16T09:54:34.366+00:00LittleCMS 2.3 releasedI am glad to the announce the release 2.3 of the LittleCMS open source color engine.<br />
<br />
Version 2.3 is a maintenance release which adresses several minor issues and increases compatibility. It fully implements the recently released ICC 4.3 standard. <br />
<br />
See the changelog for further details.<br />
<a href="http://www.littlecms.com/download.html">http://www.littlecms.com/download.html</a>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com35Girona, Spain41.9817957 2.823699900000065141.9364987 2.7661259000000653 42.0270927 2.8812739000000649tag:blogger.com,1999:blog-5413263485792241.post-85407341134267423392011-11-02T12:55:00.002+00:002011-11-02T12:55:48.094+00:00<span style="font-family: Verdana; font-size: x-small;">I've uploaded a tarball with lcms2-2.3 release candidate: <br itxtnodeid="135" /></span><a href="http://www.mail2web.com/cgi-bin/redir.asp?lid=0&newsite=http%3A%2F%2Fwww%2Elittlecms%2Ecom%2Flcms2%2D2%2E3rc2%2Etar%2Egz" itxtbad="1" itxtnodeid="133" target="_blank"><span style="font-family: Verdana; font-size: x-small;">http://www.littlecms.com/lcms2-2.3rc2.tar.gz</span></a><span style="font-family: Verdana; font-size: x-small;"> <br itxtnodeid="132" /><br itxtnodeid="131" />It is basically a maintenance release, with a number of bugs fixed. <br itxtnodeid="130" />If no issues are found, I plan to release it in a week. </span>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com12tag:blogger.com,1999:blog-5413263485792241.post-74577447237282753922011-06-10T10:49:00.000+01:002011-06-10T10:49:37.384+01:00LittleCMS 2.2 releasedI am glad to the announce the release 2.2 of the LittleCMS open source color engine.<br />
<br />
Version 2.2 adds stability, fixes all know bugs, and adds support for dictionary metatag. Pascal unit now compiles under FPK Pascal as well as Delphi. <br />
<br />
See the changelog for further details.<br />
<br />
<a href="http://www.littlecms.com/download.html">http://www.littlecms.com/download.html</a>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com17Barcelona, España41.387917 2.169918700000039341.3137835 2.0830957000000394 41.462050500000004 2.2567417000000392tag:blogger.com,1999:blog-5413263485792241.post-60293576031826934672011-06-02T15:49:00.000+01:002011-06-02T15:49:59.367+01:00Updated browser check images<div class="separator" style="clear: both; text-align: center;"><a href="http://www.littlecms.com/check_lut.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://www.littlecms.com/check_lut.jpg" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://www.littlecms.com/check_full.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://www.littlecms.com/check_full.jpg" width="320" /></a></div><br />
Still, Firefox does not work. But oh, surprise... check IE9!Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com10tag:blogger.com,1999:blog-5413263485792241.post-74926716010401840422011-05-30T14:56:00.001+01:002011-05-31T19:02:34.376+01:00lcms 2.2 release candidate<span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Times New Roman; font-size: small;"> </span><br />
</span></span><br />
<span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;"><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-family: "Verdana","sans-serif"; font-size: 10pt;">I have setup a release candidate for lcms 2.2, which includes support for dictionary metatag and fixes all know issues. I am now removing all copyrighted profiles and including RTF for the documentation, in order to fulfill Debian requirements.<o:p></o:p></span></div><span style="font-family: Times New Roman; font-size: small;"> </span><br />
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><br />
</div><div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-family: "Verdana","sans-serif"; font-size: 10pt;">See here the release candidate:<o:p></o:p></span></div><span style="font-family: Times New Roman; font-size: small;"> </span><span style="color: black; font-family: "Verdana","sans-serif"; font-size: 10pt; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;"><br />
<a href="http://www.littlecms.com/lcms2-2.2rc1.tar.gz" target="_blank"><span style="color: blue;">http://www.littlecms.com/lcms2-2.2rc1.tar.gz</span></a> <br />
<br />
or in the GIT repository, tagged as lcms2-2.2rc <br />
<br />
<a href="http://github.com/mm2/Little-CMS" target="_blank"><span style="color: blue;">http://github.com/mm2/Little-CMS</span></a> <br />
<br />
Any feedback is very welcome </span></span></span>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com12tag:blogger.com,1999:blog-5413263485792241.post-66523386732476617982011-03-10T11:12:00.001+00:002011-03-10T11:16:00.042+00:00ICC/HP Digital Print Day<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_VProTXZC56oUW422l6xZY3vOmqq4rQJ6ztwbIMFi62FT_5BAku-PMr939o7PoNaIMgHm3Z2i6-IEmJ2xJPWhYT2fZfOAQogCatduRJqTUJoNujyPRBGHg6s8FeBfZonbp2IrOJvM-A/s1600/dp11-logos.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="90" q6="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_VProTXZC56oUW422l6xZY3vOmqq4rQJ6ztwbIMFi62FT_5BAku-PMr939o7PoNaIMgHm3Z2i6-IEmJ2xJPWhYT2fZfOAQogCatduRJqTUJoNujyPRBGHg6s8FeBfZonbp2IrOJvM-A/s320/dp11-logos.gif" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;">15 June 2011 </div><div style="text-align: center;"></div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;">Co-sponsored by the Society for Imaging Science and Technology </div><br />
<br />
<div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">The International Color Consortium, in association with HP Spain, is holding a Digital Print Day at HP's Sant Cugat facility. This will be an opportunity to review and discuss recent work on digital print, focusing primarily on colour management but also encompassing screening, workflow and other related topics. </div><div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"><br />
</div><div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">Papers will be published on-line after the event on the ICC web site <a href="http://www.color.org/">http://www.color.org/</a> </div><div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"><br />
</div><div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">Abstracts should be submitted to <a href="mailto:pj.green@lcc.arts.ac.uk">mailto:pj.green@lcc.arts.ac.uk</a>by April 18 2011. Abstracts will be reviewed by a program committee and notification of acceptance sent by May 11 2011 </div><div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"><br />
</div>Papers from students of print and color are especially welcome. ICC will provide a stipend of €100 to all students presenting. A prize of €500 sponsored by HP will be awarded for the best student paper, to be decided by a panel of expert judges. <br />
Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com17tag:blogger.com,1999:blog-5413263485792241.post-54861768309012203292011-01-10T14:04:00.000+00:002011-01-10T14:04:06.656+00:00Happy new 2011!<br />
<br />
I would like to begin this year with a comment for a recurrent question:<br />
<br />
<blockquote>Can I use LittleCMS to create a profile for my camera/printer/scanner/etc?</blockquote><br />
Color management, at least ICC color management, is a two step process. <br />
<br />
You need both, ICC profiles for each device you want to integrate in the workflow and a piece of software, called "<a href="http://www2.chromix.com/ColorSmarts/smartNote.cxsa?snid=27&-session=SessID:0FCBA96902b030EB96PnW1A3BCDC">CMM</a>" that uses those profiles for doing color management. <br />
<br />
ICC color management requires all "smarts" of gamut mapping to be placed in the profiles. Then actually, building a profile involves a lot of <strong><u>art</u>.</strong> <br />
<br />
LittleCMS is a CMM. It can use those profiles to perform color management. It does NOT create profiles. It can be used to create the physical files that contains the color mappings, but it does not compute the maps. I can tell you that creating good profiles is a very difficult task, and takes teams of color scientists to define algoriths and settings, taking into account things like memory colors, skin tones, primary preservation and so. <br />
<br />
So, littlecms is useless for you if you need to create profiles from the end user point of view. As useless as it would be photoshop, which cannot create profiles neither, it only uses yet-exiting profiles. <br />
<br />
For the programmer point of view, lcms can be used to create the files that contain the colormaps, and many people are using it in such way. That would be, lcms is the canvas artists may use to do their creations. lcms would take care of all details of the profile specification. <br />
<br />
Having said that, please take a look on <a href="http://www.argyllcms.com/">ArgyllCMS</a>, a package that can create v2 profiles. Profiles created by Argyll can be used by LittleCMS without any problem.Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com3tag:blogger.com,1999:blog-5413263485792241.post-91932018730707878782010-12-17T15:37:00.002+00:002010-12-29T11:30:43.735+00:00Multithreading questionQuestion: Do I need a rocket science degree to deal with lcms2 in multithreading mode? What are ContextID and THR functions?<br />
<br />
<br />
Actually it is a lot more simple. ContexID is nothing else that a void pointer that user can associate to profiles and/or transforms. It has no meaning. Is just a sort of used defined cargo that you can use on your convenience. lcms does nothing with that . It has no relationship with threads, but can be used to store information about the thread. Obviously you can ignore it if wish so. Then, by default this void pointer is set to NULL when creating the transform or opening the profiles. Additionally, if the programmer wish, there are functions which end with THR that can set the this to values other than NULL. In this way the threads, processes or wathever that are using the profiles and transforms can retrieve the value. It is just a way to store a 32 bit value along the handles.<br />
<br />
On the other hand we have the 1-pixel cache. This is very convenient on slow interpolation methods when most of the pixels in the image are similar. Obviously, caching means the transform should store the result of last processed pixel, then in the case two threads are using the same transform at the same time, memory read/write operations on this value may clash and therefore you need some sort of semaphore. Ok, you can use a semaphore (the pthreads) or just get rid of the cache enterely. Please note that in some situations the cache is not used at all, i.e., on matrix-shaper to matrix-shaper 8 bit, it is actually faster to do always the computations, so the cache schema is discarded on this case. On CMYK trilinear, cache is being used as interpolation tends to be slow.<br />
<br />
So, to answer your questions: If you use redundant transforms, you need not to worry about anything as each transform is using different cache. May be fast, but this is big a waste of memory. If you share the same transform on several threads, which is very efficient, you have either to disable the cache or to enable pthreads. I would reccomend to disable the cache, the performance gain when using multiple threads is huge, the performance gain when using cache is small. If you need more performance, just add more threads. You have not to use cmsCreateTransformTHR, this is just a way to add a user-defined variable to the handle, and finally cmsDoTransform does not have any ContexID, the error reports the ContextID associated with the transform being used. As a hint, ContexID are more useful when you want write a memory management plug-in to specialize memory mangement for multithreading, as the memory management pluging does recive ContextID when a memory operation is requested. The testebed application does use this feature to check memory consistency.Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com11tag:blogger.com,1999:blog-5413263485792241.post-51573117890800325092010-12-10T15:02:00.004+00:002010-12-10T19:26:09.439+00:00Absolute colorimetric intentKai-Uwe Behrmann has found a nasty bug in 2.1 on absolute colorimetric intent when display profiles are involved. :-( The issue is solved in GIT, but not in the 2.1 distribution. Too bad. Well, It is not so terrible because it only affects the combination of abs. colorimetric <strong><u>and</u></strong> display profiles, but anyway ...<br />
<br />
The specs on ICC V4 are pretty messed out when regarding to absolute colorimetric intent. There is now something called "ICC absolute", which is same that relative on display profiles and preserves paper white on output profiles. Basically the observer is assumed to be fully adapted to whatever illuminant being used to create the profile, this has severe implications on monitor profiles, and no effect on printer profiles measured under D50. So right now we have the v2 absolute, wich says nothing about the observer adaptation state and v4 absolute which assumes full adaptation.<br />
<br />
I tried to do my best in supporting all modes (v2 and v4) by implementing what the white paper below describes, a knob to adjust the degree of chromatic adaptation, a feature that may be useful for match-to-screen applications. See <strong>cmsSetAdaptationState()</strong> on the manuals.<br />
<br />
<a href="http://www.color.org/ICC_white_paper_6_v2_and_v4_display_profile_differences.pdf">http://www.color.org/ICC_white_paper_6_v2_and_v4_display_profile_differences.pdf</a> <br />
<br />
Many thanks Kai-Uwe for catching the bug!Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com37tag:blogger.com,1999:blog-5413263485792241.post-79503891795462394192010-12-01T17:03:00.000+00:002010-12-01T17:03:15.832+00:00LittleCMS 2.1 releasedOk, so finally here is the release. It adds Delphi support, which is not a limited set like in lcms 1.x but a complete wrapper. Every single function in the lcms API is now accesible from Delphi. <br />
<br />
lcms 2.1 fixes a number of bugs, adds support for duotone (thanks to a contributor who wants to remain anonimous), resurrects cmsChangeBufferFormat and some features like 2-channels formatters. See the changelog for a complete list of fixes and additions.<br />
.<br />
One important thing about 2.1 is that it has been reviewed for vulnerabilities(Thanks Chris!) so it may be a good idea to upgrade from 2.0 whatever possible. The transition should be smooth as 2.1 is backwards compatible with 2.0.<br />
<br />
Now I'm ready for 2.2 :-)Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com15tag:blogger.com,1999:blog-5413263485792241.post-404308851108483372010-11-03T21:57:00.000+00:002010-11-03T21:57:49.351+00:00Release candidate for 2.1CIC18 is coming and I wish to have some fresh release to introduce at that time, so here are two packages as tarball and zip holding the GIT code and some minor additions. Should solve all known glitches up to date. If all is ok, I will do the official release on monday, nov-8. I know, this is a short notice, but the release mostly contains GIT code that has been available for a while.<br />
<br />
<a href="http://www.littlecms.com/lcms2-2.1.tar.gz">http://www.littlecms.com/lcms2-2.1.tar.gz</a><br />
<br />
<a href="http://www.littlecms.com/lcms2-2.1.zip">http://www.littlecms.com/lcms2-2.1.zip</a><br />
<br />
Enjoy!Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com1tag:blogger.com,1999:blog-5413263485792241.post-48412998258513345322010-09-18T19:12:00.002+01:002010-09-19T16:58:22.222+01:002.1 scheduleIt has been a long time since I posted the first littlecms 2 release. To my astonishment it has been reasonably stable and reliable. Sure, there have been bugs, any software has bugs, that is a fact that software developers already knows very well. But I have not been forced to do a quick release due to a killer bug, so I am happy on how is going all that lcms2 stuff.<br />
<br />
Since the old days of lcms1.0, a fresh release of the engine has been available each 6 months, more or less. So now it is time to prepare the coming of 2.1. I plan to do it on November-2010. Then, I am presenting a paper on <a href="http://www.imaging.org/ist/conferences/cic/CIC18%20Preliminary%20Program.pdf">CIC18</a> which relates with lcms2 and its unbounded mode, so the new release would be available at that time. This will be a maintenance release, with the addition of Delphi wrapper, the Matlab wrapper and some minor tweaks. BTW, this is already on the git, the release woould only qualify this code and mark it as in the "stable side".<br />
<br />
If anybody is interested, I will be also giving a talk in <a href="http://www.color.org/DevCon/devcon10.xalter">ICC DevCon</a>, this time about on how to build a minimal V2 compliant ICC engine. I will be glad to discuss any questions you have, or just have a beer with you!<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://www.color.org/DevCon/devcon10.xalter"><img border="0" qx="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5nOQJqRvBK7hhifl5M8gK4QUForSdACmhV30GJtby1ZWj8rc6XQFQMIbhUknqfU8Rz4Uh2wGu7NkaoTUHuJ0asQaYrY_Jnb7UrUW278_KK7oE4Bt4zKDOsm01w651h-z4R3JgQtFArg/s320/devcon10-logo.gif" /></a></div>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com1tag:blogger.com,1999:blog-5413263485792241.post-53093401455813608062010-07-17T20:09:00.000+01:002010-07-17T20:09:23.197+01:00Delphi wrapper is here!Now from <a href="http://www.embarcadero.com/">Embarcadero</a>. I didn't code in Delphi since five or more years ago. Found interesting changes, like the unicode thing (all strings in Delphi 10 are unicode). <br />
<br />
Otherwise I got some fun creating the wrapper unit. It encapsulates *all* LittleCMS 2 API, so probably this is a great improvement for Delphi folks.<br />
<br />
See here the DLL, the unit and a small demo. <br />
<a href="http://www.littlecms.com/lcms2_delphi10.zip">http://www.littlecms.com/lcms2_delphi10.zip</a><br />
<br />
<br />
The Delphi wrapper will be officially included in lcms distribution in version 2.1, which is scheduled for November 2010. But you can already use this (unsupported) unit.<br />
<br />
Enjoy.Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com2tag:blogger.com,1999:blog-5413263485792241.post-84149335385145800492010-06-26T18:17:00.001+01:002010-06-26T18:17:51.903+01:00Reusing same transform on different pixel typesI got this question twice, so here are some comments.<br />
<br />
cmsChangeBuffersFormat() is gone in 2.0<br />
<br />
There is a good reason to do that: <b>optimization</b><br />
<br />
When you create a transform, you supply the profiles and the expected buffer format. Then, the engine, on depending on things like number of channels and bit depth can choose to implement such transform in different ways. <br />
<br />
Let's take an example. If you create a AdobeRGB to sRGB transform using TYPE_RGB_8 for both input and output, the engine can guess that the maximum precision you would require is 8 bits, and then simplify the curve and matrix handling to, for example 1.14 fixed point. <br />
<br />
This precision is enough for 8 bits but not for 16 bits, so if you change the format after creating the transform to TYPE_RGB_16, you would end either with artifacts or throughput loss.<br />
<br />
Remember lcms 2 allows you to close the profiles after creating the transform. This is very convenient feature but prevents to recalculate the transform by reading the profile again. And there are situations, MPE for example when different precision means different tags.<br />
<br />
Overall I think the balancing of losing "change format" versus optimization and early profile closing is good. Otherwise you can always create a new transform for each format. Since you can close the profiles after creation, the amount of allocated resources should remain low.Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com1tag:blogger.com,1999:blog-5413263485792241.post-73979495771785163162010-05-29T17:09:00.004+01:002010-05-29T17:17:12.128+01:00Web color managementPlease take a look to this small toy I've been working on:<br />
<br />
<div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"><a href="http://www.littlecms.com/images/test1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" gu="true" src="http://www.littlecms.com/images/test1.jpg" /></a></div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"><br />
</div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: justify;">What do you read? Ok, maybe you can read dark text as well, but I mean the brighter one.</div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: justify;"><br />
</div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: justify;">If you have access to different web browsers, give a try to Internet explorer, Safari and Firefox for example. </div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: justify;"><br />
</div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: justify;">I was suspicious about Firefox from a while ago, now that has confirmed my theory. Oh, you can save the JPEG file and open it with photoshop to see the "good" result if you care. hint: Little CMS also works as expected. I will go deeper on this stuff in incoming posts.</div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: justify;"><br />
</div><div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"><br />
</div>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com9tag:blogger.com,1999:blog-5413263485792241.post-73492361984670236782010-05-22T10:19:00.001+01:002010-05-22T10:21:31.350+01:00Interpolation wars15 days after the release, one issue in the packaging and some glitches on linkicc. Still no big bugs. At least the reported ones are not such big to need a 2.1 release... yet.<br />
<br />
Little CMS releases have been historically dropped each 6 months, so 2.1 should come on October-November more or less. I have a talk on the ICC DevCon on November, so it would be nice to have 2.1 released to at that time.<br />
<br />
Otherwise the git is alive and I'm periodically committing fixes to it. If you are using Little CMS code and don't have dependencies on linux distributions, I would recommend to use git code if possible.<br />
<br />
One of those small glitches found is a weird error that was reported by a HP folk days ago. He was seeing<br />
small differences on a CMYK profile when upgrading from 1.19 to 2.0<br />
<br />
So, after investigation, I found the reason of those differences: <a href="http://www.google.com/url?sa=t&source=web&ct=res&cd=6&ved=0CDYQFjAF&url=http%3A%2F%2Flink.aip.org%2Flink%2F%3FPSISDG%2F1909%2F127%2F1&rct=j&q=Tetrahedral+interpolation&ei=DJ33S5i4OIHaNuT4sYQI&usg=AFQjCNG1DvyPFqhmMg3SCb34tuinOK6gHA&sig2=vdNS_F2rasun7cKOvNQiKQ">Tetrahedral interpolation</a> being used in 2.0 and <a href="http://en.wikipedia.org/wiki/Trilinear_interpolation">Trilinear interpolation</a> in 1.19. Tetrahedral was <a href="http://www.freepatentsonline.com/5581376.html">patented</a> time ago, but now the patent has expired.<br />
<br />
In fact, I did see such issue many years ago. On LUT elements being indexed by Lab colorspace, Tetrahedral does <b>not</b> work well. I suspect that's because Luma is uncentered (L is on one axis)<br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://blogs.mathworks.com/images/steve/96/tetrahedral_interpolation_02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://blogs.mathworks.com/images/steve/96/tetrahedral_interpolation_02.png" width="320" /></a></div>First thing to discard was a code bug. So I tried Max Derhak's SampleICC. To my astonishment, SampleICC is also using trilinear by default. Tried to modify Max code to do the interpolation as tetrahedral and... bingo! the same "bad" results as Little CMS. Up to four decimals. So here we go, the "bug" is in the interpolation algorithm. I checked PhotoShop CS4. It seems to be also using trilinear as well.<br />
<br />
Now I have committed those changes to git. Note however, that your are not going to notice any difference but in very few profiles, and even in this case, maximum difference is about 2-3 digital counts (0.5 dE)Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com2tag:blogger.com,1999:blog-5413263485792241.post-27000391942388632782010-05-08T19:16:00.000+01:002010-05-08T19:16:58.972+01:00 I am pleased to the announce the release 2.0 of the LittleCMS open source color engine.<br />
<br />
<div> Version 2.0 is an important milestone, among other improvements, it delivers: </div><ul><li>Full implementation of the ICC standard </li>
<li>Improved documentation </li>
<li>Better portability </li>
<li>Easier extensibility</li>
</ul><br />
<div>Migration to 2.x branch is highly encouraged. </div><div> </div><br />
<div>Little CMS intends to be a small-footprint color management engine, with special focus on accuracy and performance. It uses the International Color Consortium standard (ICC), which is the modern standard when regarding to color management. The ICC specification is widely used and is referred to in many International and other de-facto standards.</div><div> </div><div>For more information, please take a look on: </div><br />
<div>Main site: </div><a href="http://www.littlecms.com/">http://www.littlecms.com/</a><br />
Downloads:<br />
<a href="http://www.littlecms.com/download.html">http://www.littlecms.com/download.html</a><br />
<br />
<div> </div>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com6tag:blogger.com,1999:blog-5413263485792241.post-43865135510859834852010-04-20T11:46:00.000+01:002010-04-20T11:46:23.212+01:00LittleCMS 2.0 release dateBeta 3 seems stable enough, so now I can set a final release date for lcms2.<br />
<br />
<div style="text-align: center;"><b>LittleCMS 2.0 will hopefully be released on Saturday, May-8-2010</b></div><br />
So, if you have found a bug, inconsistency, etc. Please let me know ASAP. Code is now frozen and I will start the final qualification phase. All change requests will be studied before commit, just to minimize risk. Thanks again to all people that has contributed to this project!Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com2tag:blogger.com,1999:blog-5413263485792241.post-53931269454293137602010-04-07T09:51:00.000+01:002010-04-07T09:51:38.322+01:00Beta3 and release candidateHere is beta3. We are almost done, so this is the release candidate.<br />
<ul><li>All known bugs are fixed. </li>
<li>There are some improvements in CMYK interpolation, it is about 20% faster </li>
<li>jpgicc can now apply devicelinks without chrashing</li>
<li>Matlab support is there!</li>
</ul>Final release will follow in a month, so if you want to check the CMM in your application, now is a good time to do so. The code seems stable enough, and you will catch small issues .Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com2tag:blogger.com,1999:blog-5413263485792241.post-55536933534013384032010-03-04T16:45:00.000+00:002010-03-04T16:45:15.258+00:00Beta 2 is readyTime for a new beta. First one was very successful and several important bugs were found and fixed.<br />
<br />
Beta2 will focus on quality and documentation, and will rest for a month.<br />
<br />
I will give frequent updates on the status of the beta. You can download it from the link on the right.Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com7tag:blogger.com,1999:blog-5413263485792241.post-48572995232368946072010-03-01T16:59:00.001+00:002010-03-01T17:03:16.955+00:00xput comparative 1.19 vs. 2.0<b></b><br />
<br />
<div style="font-family: inherit;"><span style="font-size: small;">Here is the comparative for the code in git. I will publish beta2 in a couple of days. As you can see the xput improvements are considerable.</span></div><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span><br />
<br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">1.19</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">-----</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on CLUT profiles : 10.6667 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on CLUT profiles : 9.75015 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on Matrix-Shaper profiles : 3.8638 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on SAME Matrix-Shaper profiles : 4.28495 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on Matrix-Shaper profiles (AbsCol) : 10.4507 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on Matrix-Shaper profiles : 3.92349 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on SAME Matrix-Shaper profiles : 3.96924 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on Matrix-Shaper profiles (AbsCol) : 10.6667 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on curves : 4.33839 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on curves : 4.3944 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on CMYK profiles : 4.09626 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on CMYK profiles : 3.96924 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on gray-to-gray : 24.3902 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on SAME gray-to-gray : 24.3902 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">2.0</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">----</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on CLUT profiles : 10.1394 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on CLUT profiles : 10.6667 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on Matrix-Shaper profiles : 26.2726 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on SAME Matrix-Shaper profiles : 30.1318 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on Matrix-Shaper profiles (AbsCol) : 10.5541 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on Matrix-Shaper profiles : 10.2433 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on SAME Matrix-Shaper profiles : 9.84615 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on Matrix-Shaper profiles (AbsCol) : 10.6667 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on curves : 30.0752 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on curves : 35.3201 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on CMYK profiles : 4.19727 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on CMYK profiles : 4.26667 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on gray-to-gray : 40.9207 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on SAME gray-to-gray : 40.9207 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on CMYK profiles : 4.3573 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">16 bits on CMYK profiles : 4.55192 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on gray-to-gray : 39.312 MPixel/sec.</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">8 bits on SAME gray-to-gray : 40.9207 MPixel/sec.</span></span>Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com1tag:blogger.com,1999:blog-5413263485792241.post-48294211500430738832010-02-15T17:31:00.001+00:002010-02-15T17:33:57.042+00:00Speed measurementsHere are some performance numbers, measured on my laptop. This is a pretty old compaq nc6400, <span class="width490" style="font-size: 12px; line-height: 20px;"><span id="intelliTxt" name="intelliTxt">Dual core T2300E (1.66GHZ)</span></span> so it should rock in a modern machines. Note how fast transforms go when both profiles are implemented as matrix shaper. The measurements are using the code on git.<br />
<br />
16 bits on CLUT profiles.. 5.95238 Mpixel/sec.<br />
8 bits on CLUT profiles...10.5541 Mpixels/sec.<br />
8 bits on Matrix-Shaper profiles..27.6817 Mpixels/sec.<br />
8 bits on SAME Matrix-Shaper profiles...36.5297 Mpixels/sec.<br />
8 bits on curves... 29.2505 Mpixels/sec.<br />
8 bits on Matrix-Shaper profiles (AbsCol)...27.6817 Mpixels/sec.<br />
16 bits on curves... 37.9147 Mpixel/sec.<br />
8 bits on CMYK profiles... 8.90373 Mpixels/sec.<br />
16 bits on CMYK profiles...4.45186 Mpixel/sec.<br />
8 bits on gray-to-gray conversions.. 32.9897 Mpixels/sec.<br />
8 bits on same gray-to-gray conversions ...39.312 Mpixels/sec.Marti Mariahttp://www.blogger.com/profile/06043898000962120199noreply@blogger.com3