<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title></title>
	<atom:link href="http://www.marcelpatek.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcelpatek.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 20 Feb 2012 22:42:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Browsers &amp; Color Management II &#8211; the Code</title>
		<link>http://www.marcelpatek.com/blog/2011/12/23/cm-code/</link>
		<comments>http://www.marcelpatek.com/blog/2011/12/23/cm-code/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 15:15:10 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Color management]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1343</guid>
		<description><![CDATA[This post follows on the Browsers &#38; Color Management I &#8211; Sending Color Patches in through the Web Browser with more details on the code used to drive images through the browser window. As one might have expected, three components were needed: html, css, and some sort of JavaScript. For the latter, I picked jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>This post follows on the <a href="http://www.marcelpatek.com/blog/2011/11/27/cm-patches/">Browsers &amp; Color Management I &#8211; Sending Color Patches in through the Web Browser</a> with more details on the code used to drive images through the browser window. As one might have expected, three components were needed: html, css, and some sort of JavaScript. For the latter, I picked jQuery library (jquery-1.7.min.js) which is well suited for this task.</p>
<h2></h2>
<h2><strong>About the code:</strong></h2>
<p>jQuery code used in this project is essentially a slideshow script that works on the client side. That explains why we do not need any active connection to the Internet. It will run in our browser providing that JavaScript is enabled. Since it turns images into a slideshow, it can be used for many other purposes, e.g., to display photos on our personal web site. jQuery is <a title="Free and open source software" href="http://en.wikipedia.org/wiki/Free_and_open_source_software">free, open source software</a>, <a title="Dual-licensing" href="http://en.wikipedia.org/wiki/Dual-licensing">dual-licensed</a> under the <a title="MIT License" href="http://en.wikipedia.org/wiki/MIT_License">MIT License</a> or the <a title="GNU General Public License" href="http://en.wikipedia.org/wiki/GNU_General_Public_License#Version_2">GNU General Public License, Version 2</a> and it is included in the &#8220;js&#8221; folder inside the zip file.</p>
<div class="space"></div>
<p>If you have not done so before, download it here:</p>
<div class="space"></div>
<p><a href="http://www.marcelpatek.com/blog/wp-content/plugins/download-monitor/download.php?id=patches1_0_1.zip"> Patches1.0.1.zip v 1.01 </a>  <img style="margin: 0px 10px -5px 10px" src="http://www.marcelpatek.com/blog/wp-content/downloads/zip.gif" width="20" height="20" alt="Patches1.0.1.zip" />  |   Complete set of files. Fixed a minor error in the index increment and displaying full set of images.  &#8211;  [downloaded 1 times]</p>
<div class="space"></div>
<div class="note">
<div class="noteclassic">The code below is just a sample of the whole script with associated files, shown only to outline the structure and logic of the script.</div>
</div>
<div class="space"></div>
<div class="space"></div>
<p><span id="more-1343"></span></p>
<div class="separator"></div>
<div class="space"></div>
<p id="part1" style="padding-left: 30px;"><span style="color: #ff00ff;">manual_patches.js [part 1]</span></p>
<div class="space"></div>
<p>The script starts with declaration of several variables. These are mostly arrays that are used to store different sets of images. Function &#8220;mainimage()&#8221; (line 9) is the heart of the script. It takes index &#8220;nr&#8221; and displays the next image in &#8220;array0&#8243;. Interestingly, there are three calls to the white patch, all in order to provide a stage at which a measuring device can read the white point. During the &#8220;onclick&#8221; event at the &#8220;Next&#8221; button, the first white patch will hide (line 5, [<a href="#part3">part 3</a>], id=&#8221;white&#8221;). Next, mainimage() function will fire up by fading out another instance of the white patch (class=&#8221;img1&#8243;) and the index will advance to &#8220;0&#8243;. This happens at line 10 with the &#8220;complete&#8221; callback function that is fired once the fadeOut event is complete. Only then, the next image in array fades in (second image). Index gets incremented by the event function (lines 4, 17 in the [<a href="#part3">part 3</a>]) and its value will be displayed in the Patch field which is &lt;p&gt; element of the html document with id attribute of &#8220;count&#8221; (&lt;p id=&#8221;count&#8221;&gt; &lt;/p&gt;).</p>
<pre class="brush: jscript; title: ; notranslate">
// Declare global variables
var index = -1; // accounting for the three white patches
var array0 = [];
var array1 = [];
var array1a = [];
var spaces = [&quot;untagged&quot;, &quot;srgb&quot;, &quot;argb&quot;, &quot;prophoto&quot;];

// Main slideshow function
function mainimage(nr) {
      // when run, move from the first image to the next one
     $(&quot;div.mainimg ul li:eq(0) div img&quot;).fadeOut({&quot;duration&quot;:100, complete:function() {
         $(this).attr(&quot;src&quot;,array0[nr]).fadeIn(100); //display image from the array based on the index and src attribute
         nr = index; //this will set the index of the currently selected image
	$('#count p').html('Patch: '+ (index+1) + ''); // display image sequence number
         };
</pre>
<div class="space"></div>
<div class="separator"></div>
<div class="space"></div>
<p id="part2" style="padding-left: 30px;"><span style="color: #ff00ff;">manual_patches.js [part 2]</span></p>
<div class="space"></div>
<p>Next goes a general wrapper function() used for several events and settings. At the beginning, default settings are defined, such as, default color space (untagged), array0 that contains src attribute of all images, default count of images and its screen output for &#8220;Total images: &#8220;. Script then follows by generating CSS buttons which have the &#8220;<em>onclick</em>&#8221; event attached to each of them.</p>
<div class="space"></div>
<p>The key part of the wrapper function is the selection of color spaces (line 20). It involves the standard &#8220;click()&#8221; function that sets the color space variable and css styling upon the click event. There are four selection calls that have very similar structure. Once the color space variable is set, the main array0 is generated by calling the function &#8220;makearray()&#8221; at line 48. At the same time, radio button for the set selection is cleared to have no default state (line 39).</p>
<div class="space"></div>
<p>Now, about the &#8220;makearray()&#8221; function. It looks at the src path of each image in #photos  html tag and alters the hard-coded path by substituting the default path with the current space variable set above upon the click event (e.g., line 35). This is done with help of the callback function (index, attr). In the next step, an array of image src tags is created using the &#8220;each&#8221; method. Actually, two arrays are created; one with the full set of images (array1) and another one with the limited set of images (array1a). Which array to use depends on the radio button selection (line 66). Conditional statement and two methods of copying arrays are used. Finally, the total image count is updated by reading the array0 length.</p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
$(function(){
// Set defaults
 		 curr_space = spaces[0]; // untagged images are set as default
		 makearray(); //run function defined at line 48
		 array0 = array1a.slice(); // plain copy of array1a
		 totalimages = 12;
		 $('#total p').html('Total images: '+ totalimages + '');

//Prepare radio and CSS buttons
	$(&quot;#patch-area&quot;).append('&lt;a id=&quot;next&quot; onclick=&quot;next();&quot; href=&quot;#&quot;&gt;Next&lt;/a&gt;');
	$(&quot;#patch-area&quot;).append('&lt;a id=&quot;reset&quot; onclick=&quot;reset();&quot; href=&quot;#&quot;&gt;Reset&lt;/a&gt;');
	$(&quot;#patch-area&quot;).append('&lt;a id=&quot;previous&quot; onclick=&quot;previous();&quot; href=&quot;#&quot;&gt;Previous&lt;/a&gt;');

           $('input').click(function () {
           $('input:not(:checked)').parent().removeClass(&quot;selected&quot;); // box selection styling
           $('input:checked').parent().addClass(&quot;selected&quot;);
              });

//-----------------------&gt; select color space
$(&quot;#untagged&quot;).click(function(){
		if ($(this).text() == &quot;Untagged - No CM&quot;) 	{
		$(this).text(&quot;Untagged - No CM&quot;);
		$('#selection a').css('background','#000F7D');
		$('#untagged').css('background','#ac0000');
		 curr_space = spaces[0];	// Set space for this option
		 makearray(); // make the array - see below
		 			}
		});

$(&quot;#srgb&quot;).click(function(){
		if ($(this).text() == &quot;sRGB&quot;) {
		$(this).text(&quot;sRGB&quot;);
		$('#selection a').css('background','#000F7D');
		$('#srgb').css('background','#ac0000');
		curr_space = spaces[1]; // Set space for this option
		array0 = []; // Clear all arrays
		array1 =[];
		array1a = [];
		$('#source2').prop('checked', false); // Clear selection of the set (radio buttons)
		makearray();
				 	}
		});

//............ similar for other color spaces
// -----------------------------&gt; end of space selection
//-------------------------------&gt; function to prepare arrays based on space

function makearray() 	{
	$('img').attr('src',function(index,attr){ // Create correct path to images based on the selected color space
        return attr.replace(/srgb|argb|prophoto|untagged/,curr_space);
   		     });

	$('#photos img').each(function() { // take all images from #photos in index.html
    	array1.push($(this).attr('src')); // and push their src attribute into array1
			});

	$('#photos img').filter('.keep').each(function() { // take some images from #photos (gray and primaries)
    	array1a.push($(this).attr('src')); // and push their src attribute into an array1a
			});

//-----------------------------&gt; Select which set of images to run

     $(&quot;input[name='set']&quot;).live('click', function(){
 	 var radio_value = $(this).val(); // Get the button value after it is clicked

  	 if(radio_value == 'short') {
   	 	array0 = array1a.slice(); } // Just gray and primaries
   	 else 	{
   	 	array0 = []; //Empty Array0 and assign it again in the next step
   	 	array0 = array1; // Full set of patches
   		};

 	totalimages = array0.length; //  Update Array0 size and print it to the screen
 	$('#total p').html('Total images: '+ totalimages + '');
				});

					          }
});
</pre>
<div class="space"></div>
<div class="separator"></div>
<div class="space"></div>
<p id="part3" style="padding-left: 30px;"><span style="color: #ff00ff;">manual_patches.js [part 3]</span></p>
<div class="space"></div>
<p>The scripts ends with section of &#8220;events&#8221;, specifically with assignment of events to buttons  NEXT, PREVIOUS, and RESET. These assignments consist of index increment (decrement), text styling (hide), and trigger of the main slideshow (mainimage(index)) at the line 8. Reset to the original state is executed by the &#8220;window.location.reload(true)&#8221; statement.</p>
<div class="space"></div>
<pre class="brush: jscript; title: ; notranslate">
// Events
function next() {
        if (index &lt; array0.length) {
            index++;
            $('#white').hide(); // Hide the white patch
            $('#container ol li').hide(); //Hide instruction area
            $('#third').hide(); // Hide the instruction header
            mainimage(index); //start the slideshow
           }
        else {
        	window.location.reload(true); // reset to beginning
        	 }
       };

function previous() {
        if (index &lt; array0.length &amp; index &gt; 0) {
            index--;
            mainimage(index);
           }
        else {
        	window.location.reload(true); // reset to beginning
        	 }
       };

function reset() {
        	window.location.reload(true); // reset to beginning
        	};
</pre>
<div class="separator"></div>
<div class="space"></div>
<p id="index" style="padding-left: 30px;"><span style="color: #ff00ff;">index.html, only part</span></p>
<div class="space"></div>
<p>The main part of XHTML mark-up is outlined below. The body tag opens with a typical block level element &lt;div&gt; with <em>id</em> attribute of &#8220;container&#8221;. Navigation mark-up follows next wrapped in another &lt;div&gt; tag with<em> id</em> &#8220;selection&#8221;. Those are color space buttons, counters, radio buttons and their description. Patch area starts at line 28 with <em>div</em> element encapsulating the first white patch (lines 28-29). This patch is not part of the animation and serves the purpose of calibrating the measuring device. Another instance of the white patch is defined in another <em>div</em> element with class &#8220;mainimg&#8221; (lines 31-35). This is the first image that fades out when the animation starts.</p>
<p>Next is the complete list of available images wrapped in<em> div</em> element with <em>id</em> &#8220;photos&#8221;. Each image either has class &#8220;keep&#8221; associated with it or has no class at all. In the former case, the &#8220;keep&#8221; class &#8220;marks&#8221; the image for inclusion in the &#8220;shorter&#8221; list of gray ramp and primaries. Sub-directory &#8220;untagged&#8221; is the default part of <em>src</em> path. It is this part that gets replaced by the chosen color space variable (on &#8220;click&#8221; event) through the jQuery script. If you wish to provide your own set of images, it is the place where they would be entered.</p>
<div class="space"></div>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;container&quot;&gt;
   &lt;div id=&quot;selection&quot;&gt;
    &lt;a id=&quot;untagged&quot; href=&quot;#&quot;&gt;Untagged - No CM&lt;/a&gt;
    &lt;a id=&quot;srgb&quot; href=&quot;#&quot;&gt;sRGB&lt;/a&gt;
    &lt;a id=&quot;argb&quot; href=&quot;#&quot;&gt;Adobe98 RGB&lt;/a&gt;
    &lt;a id=&quot;prophoto&quot; href=&quot;#&quot;&gt;Pro Photo&lt;/a&gt;

   &lt;div id=&quot;total&quot;&gt;Total Images:&lt;/div&gt;
   &lt;div id=&quot;count&quot;&gt;Patch: white&lt;/div&gt;

&lt;ul id=&quot;radio&quot;&gt;
&lt;li&gt;&lt;input id=&quot;source1&quot; type=&quot;radio&quot; name=&quot;set&quot; value=&quot;all&quot; class='ctrl'&gt;&lt;/input&gt;
&lt;label for=&quot;source1&quot;&gt;All available patches&lt;/label&gt;
&lt;/li&gt;
&lt;li&gt;&lt;input id=&quot;source2&quot; type=&quot;radio&quot; name=&quot;set&quot; checked=&quot;checked&quot; value=&quot;short&quot;&gt;&lt;/input&gt; &lt;!-- Default state is &quot;checked&quot;--&gt;
&lt;label for=&quot;source2&quot;&gt;Gray ramp and Primaries&lt;/label&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt; &lt;!-- close selection --&gt;

&lt;div id=&quot;first&quot;&gt;&lt;a href=&quot;#&quot;&gt;[2]&lt;span&gt;
Choose and click which set of patches you wish to run.&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;second&quot;&gt;&lt;a href=&quot;#&quot;&gt;[1]&lt;span&gt;
Always click &quot;Reset&quot; first. Then click the desired tab above to select patches with a specific
embedded color profile.&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;

&lt;h2&gt;RGB patches&lt;/h2&gt;
&lt;div id=&quot;patch-area&quot;&gt;
   &lt;div id=&quot;white&quot;&gt;&lt;img src=&quot;images/white.jpg&quot; alt=&quot;white&quot; /&gt; &lt;!-- show the white patch for instrument calibration --&gt;&lt;/div&gt;

&lt;div class=&quot;mainimg&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;div&gt;&lt;img alt=&quot;n-255&quot; src=&quot;images/untagged/n-255.jpg&quot; /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div id=&quot;photos&quot;&gt;&lt;!-- Customize the patches below. Keep the syntax. --&gt;
&lt;img src=&quot;images/untagged/n-255.jpg&quot; alt=&quot;n-255&quot; /&gt;
&lt;img src=&quot;images/untagged/n-223.jpg&quot; alt=&quot;n-223&quot; /&gt;
................... and so on for the all patches ..............
&lt;img src=&quot;images/untagged/b-0.jpg&quot; alt=&quot;b-0&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;!-- closing patch-area--&gt;
</pre>
<div class="space"></div>
<p>Again, all discussed files including html file and css styling sheet are included in the zipped file through the download.</p>
<div class="space"></div>
<div class="separator"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/12/23/cm-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Browsers &amp; Color Management I &#8211; Sending Color Patches through the Web Browser</title>
		<link>http://www.marcelpatek.com/blog/2011/11/27/cm-patches/</link>
		<comments>http://www.marcelpatek.com/blog/2011/11/27/cm-patches/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 01:18:28 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Color management]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1163</guid>
		<description><![CDATA[While writing my previous posts on color management and web browsers [1, 2], I realized that instead of guessing as to whether a browser understands how to manage colors, a few measurements of color patches would go a long way. Questions, such as, what will happen with untagged images in Chrome 11 or is it [...]]]></description>
			<content:encoded><![CDATA[<p>While writing my previous posts on color management and web browsers [<a href="http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/">1</a>, <a href="http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/">2</a>], I realized that instead of guessing as to whether a browser understands how to manage colors, a few measurements of color patches would go a long way. Questions, such as, what will happen with untagged images in Chrome 11 or is it safe to use sRGB profile for photos displayed on a wide-gamut monitor would then be easier to answer. By all means, these questions are not trivial and would deserve an in-depth study of the browser documentation and perhaps many hours spent on Google. Unfortunately, with many browsers one would still be unclear on the exact way by which are the (un)tagged images processed.</p>
<div class="space"></div>
<p>To address browser color capabilities in the most straightforward way, we would just send images of RGB primaries through the browser and record their colorimetric values. In order to do that, we would need a set of images that are either untagged (no color space information is associated with them) or images that carry color space information in the form of icc/icm profile. After the measurement is done, a quick comparison with known CIE 1931 chromaticity coordinates of RGB primaries of standard color spaces (sRGB, Adobe98 RGB, Pro Photo RGB) would reveal any color processing done by the browser. To measure the radiometric output, we can use the same device that we use to calibrate our display.</p>
<div class="space"></div>
<p>To make measurement of colors from within a browser easier, I provide jQuery script that displays different color patches and allows measurement in a semi-manual manner. The script runs in any browser that has JavaScript enabled. Included are gray and RGB ramps in four different variants; <span style="text-decoration: underline;">untagged</span> and <span style="text-decoration: underline;">tagged</span> with sRGB, Adobe98 RGB, and ProPhoto RGB icc profiles. After measuring these patches directly from the browser, we can both judge its color management capabilities and also obtain display characteristics, such as, display <em>gamma</em>, color temperature and <em>gamma</em> values for each RGB channel. On that later (link).</p>
<div class="space"></div>
<h1 style="padding-left: 60px;"><span style="font-size: medium;">The Upshot of the Script:</span></h1>
<ul>
<li>Inter-browser compatibility (IE, Chrome, Firefox, Safari, Opera, &#8230;)</li>
<li>No installation (all necessary files are included)</li>
<li>No need to be connected to the Internet</li>
<li>Simple navigation (NEXT, PREVIOUS, RESET)</li>
<li>Customizable (supply your own images)</li>
<li>Free</li>
</ul>
<div class="space"></div>
<p><span id="more-1163"></span></p>
<div class="space"></div>
<div class="separator"></div>
<h2><strong>How to prepare the script:<br />
</strong></h2>
<p style="padding-left: 60px;"><strong><span style="color: #ff0000;">To begin, first download the necessary files (the latest version):</span></strong></p>
<p style="padding-left: 30px;"><a href="http://www.marcelpatek.com/blog/wp-content/plugins/download-monitor/download.php?id=patches1_0_1.zip"> Patches1.0.1.zip v 1.01 </a>  <img style="margin: 0px 10px -5px 10px" src="http://www.marcelpatek.com/blog/wp-content/downloads/zip.gif" width="20" height="20" alt="Patches1.0.1.zip" />  |   Complete set of files. Fixed a minor error in the index increment and displaying full set of images.  &#8211;  [downloaded 1 times]</p>
<p style="padding-left: 30px;">
<div class="space"></div>
</p>
<ol>
<li>Unzip the zip file into a folder (it self-extracts into folder &#8220;patches&#8221;) and place the folder structure anywhere on your computer (e.g. in c:/ ).</li>
<li>Double-click on the index.html file in the main folder. Alternatively, drag the index.html file to the browser window.</li>
<li>Depending on the Security policy settings of your computer,  you will want to confirm (OK, Agree, &#8230;) the message saying something about the JavaScript, Active-X to be allowed.</li>
<li>The following page will appear in the browser window.</li>
</ol>
<p><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/12/main_structure.png" rel="shadowbox[sbpost-1163];player=img;" title="Step 1"><img class="aligncenter size-full" title="Step 1" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/12/main_structure.png" alt="" width="672" height="642" /></a></p>
<div class="separator"></div>
<h2><strong>How to run the patch animation:</strong></h2>
<ol>
<li>To make sure that everything is in the initial state, press RESET.</li>
<li>If you wish to run Untagged series first, just check which set to run (All or Gray &amp; Primaries) <strong><span style="color: #ff0000;">[2]</span></strong> and proceed by clicking  NEXT.<strong><span style="color: #ff0000;"><br />
</span></strong></li>
<li>For other color spaces, choose the color profile (icc profile) associated with the image set by clicking the corresponding red tab at the top <strong><span style="color: #ff0000;">[1]</span></strong> (Untagged is the default).</li>
<li>Select the set of images to run (All or Gray &amp; Primaries) <strong><span style="color: #ff0000;">[2]</span></strong>. &#8220;Gray ramp and Primaries&#8221; has 12 images (default); 7 gray ramps, 3 RGB patches and the black and white patches. &#8220;All available patches&#8221; include the gray ramp from the above, 7 patches each of the red, green, and blue ramps and the black and white patches  (total of 36).</li>
<li>Read steps in the note<strong><span style="color: #ff0000;"> [3]</span></strong> to calibrate the measuring device and acquire reading of the white patch.</li>
<li>Use the NEXT, PREVIOUS buttons to advance or step back.  At the end of the cycle, script resets into the default state.</li>
</ol>
<div class="note">
<div class="notetip">If something goes wrong, press RESET.  </div>
</div>
<div class="space"></div>
<div class="separator"></div>
<h2><strong>How to measure patches:</strong></h2>
<p>Unfortunately, there are limited options when it comes to manual measurements off the screen that are not driven by a specific display calibration package. The good news is there are still a few free software applications. These include <a href="http://www.argyllcms.com/" target="_blank">Argyll CMS</a> and homecinema-fr colormeter at <a href="http://www.homecinema-fr.com/colorimetre/index_en.php" target="_blank" class="broken_link">HCFR</a>. On the commercial side, I prefer using the <a href="http://www.babelcolor.com/#CTandA" target="_blank">BabelColor CT&amp;A</a>.</p>
<p>I described setup and use of all of the mentioned applications on my <a href="http://www.marcelpatek.com/" target="_blank">Techpages</a>, specifically at: <a href="http://www.marcelpatek.com/argyll.php" target="_blank">Argyll CMS &#8211; examples of use</a>,  <a href="http://www.homecinema-fr.com/colorimetre-hcfr/hcfr-colormeter/" target="_blank">HCFR Colorimetere</a>, and <a href="http://www.marcelpatek.com/cta.php#wp" target="_blank">BabelColor CT&amp;A</a>.</p>
<div class="space"></div>
<p>I will go into measurements and results in more details later. At this point, I will continue with <a href="http://www.marcelpatek.com/blog/2011/12/23/cm-code">discussion of the code used in this project</a>.</p>
<div class="space"></div>
<div class="separator"></div>
<div class="space"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/11/27/cm-patches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling color management in Google Chrome</title>
		<link>http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/</link>
		<comments>http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 23:04:31 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[color profile]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=1093</guid>
		<description><![CDATA[In my previous post, I provided a step-by-step guide to enable full color management in the Mozilla Firefox browser. While Firefox handles colors in a very respectful way, there are other browsers that cannot be setup (yet) to effectively manage colors (IE, Opera). For some time, Google Chrome was not capable of managing colors also [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/#more-885">my previous post</a>, I provided a step-by-step guide to enable full color management in the Mozilla Firefox browser. While Firefox handles colors in a very respectful way, there are other browsers that cannot be setup (yet) to effectively manage colors (IE, Opera). For some time, Google Chrome was not capable of managing colors also or its setup was just undocumented. However, while there are several pages on the Internet describing how to enable color management in Chrome, results are often unreliable (read more below).</p>
<p>
<div class="note">
<div class="noteclassic">In general, the first part of troubleshooting annoying color shifts is checking that our monitor is <a href="http://www.marcelpatek.com/monitor.html">calibrated and profiled</a>.</div>
</div>
<p>This post will show modification in a simple start-up option that enables management of colors in the Chrome browser (I am intentionally avoiding the term &#8220;color management&#8221; for the reasons explained below).</p>
<p><span id="more-1093"></span></p>
<p>When enabled, then regardless if the image is or it is not tagged with icc profile, its color interpretation will default to the computer system color space (sRGB under Windows OS) and resulting RGB values are then sent straight to the monitor. If monitor icc profile is assigned in the &#8220;Default monitor profile&#8221; section, colors will be ultimately converted to sRGB color space.</p>
<p>In short, for calibrated and profiled or any decent monitor, results for tagged and untagged images will be just fine. However, troubles may arise when using a wide-gamut monitor.</p>
<p>The setup described below will ensure that most images from the Web will be faithfully displayed on your monitor, especially on wide-gamut monitors. It is also important to note that Chrome is not color managing images in the strict sense. Instead, if enabled, it treats all images as if they were in sRGB color space. The net result is that regardless of the monitor gamut, images are displayed in the web-safe sRGB color space.</p>
<p style="padding-left: 30px;"><span style="font-size: medium;"><strong>Here is how to proceed (in Google Chrome browser):</strong></span></p>
<ol>
<li>
<pre>Right-mouse click the Chrome icon and select Properties.</pre>
</li>
<li>
<pre>Add --enable-monitor-profile at the end of the path in the Target field. Use double quotes as seen in the screenshot. <a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/chrome_CM.png" rel="shadowbox[sbpost-1093];player=img;" title="Step 1"><img class="aligncenter size-full" title="Step 1" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/chrome_CM.png" alt="" width="367" height="509" /></a></pre>
</li>
<li>
<pre>Click the OK button and restart Chrome.</pre>
</li>
</ol>
<pre> </pre>
<p>That&#8217;s it. Chrome should now display images in the &#8220;web save&#8221; mode.</p>
<p>
<div class="note">
<div class="notetip">For users of multiple monitors or monitors with different gamut, read more !!</div>
</div>
<p>Unfortunately, until recently, I was not able to get the Chrome manage colors (over-saturation mostly) on my tagged images. First, I must say that I am running two monitors off the XP-SP3 computer. Moreover (complicating aspect), one of my monitors is a wide-gamut display. Both displays are calibrated and profiled and behave very good when editing photos in Photoshop on either one of them. Looking deeper into color problem in Chrome, I noticed that there is no monitor profile explicitly entered when enabling the color management (in contrast to Firefox). That leads to a question what profile is used by Chrome? It turns out that there is no profile used, but instead RGB values embedded in the image are assigned the monitor color space and then are converted to sRGB color space. However, for this transformation to happen, one has to set the default monitor profile by clicking &#8220;Set As Default&#8221; as shown in the picture below. This is not immediately intuitive, but it is important when viewing images on the wide-gamut monitor. On a standard monitor, differences are negligible.</p>
<p><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_dproperties.png" rel="shadowbox[sbpost-1093];player=img;" title="Step 2"><img class="alignleft size-full" title="Step 2" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_dproperties.png" alt="" width="404" height="455" /></a><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_cm.png" rel="shadowbox[sbpost-1093];player=img;" title="Step 3"><img class="alignright size-full" title="Step 3" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/xp_cm.png" alt="" width="404" height="492" /></a></p>
<div class="space"></div>
<p>In situation where two monitors of different gamuts are run, I suggest to set the Default profile (above) to the wide-gamut display.<br /> 
<div class="note">
<div class="notewarning">Assigning sRGB as the Default monitor space under Windows (XP-SP3) causes the wide-gamut monitor to display any image (tagged or untagged) as sRGB converted image (good and safe). However, on a regular monitor, colors get desaturated in reds and greens. Assigning icc/icm monitor profile as the Default space results in conversion into (or assignment of) sRGB space on the very monitor which profile was assigned as Default. On other monitor(s), native RGB primaries are used to display the image.</div>
</div>
<p>In summary, for users of two or more monitors from which at least one is wide-gamut display, set the &#8220;Default monitor profile&#8221; in Windows to the wide-gamut monitor profile and have the Chrome to display images on that same wide-gamut monitor.</p>
<div class="separator"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/11/19/enabling-color-management-in-google-chrome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Full color management in Firefox &#8211; settings</title>
		<link>http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/</link>
		<comments>http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:44:56 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=885</guid>
		<description><![CDATA[Every day, hundreds of thousands of photos are uploaded to the web. There are many web surfers, photography amateurs, pros and photo agencies browsing for the best pictures. Nothings gets more frustrating then seeing an image that took several hours of editing and rigorous color management discipline, only to realize that colors got shifted and [...]]]></description>
			<content:encoded><![CDATA[<p>Every day, hundreds of thousands of photos are uploaded to the web. There are many web surfers, photography amateurs, pros and photo agencies browsing for the best pictures. Nothings gets more frustrating then seeing an image that took several hours of editing and rigorous color management discipline, only to realize that colors got shifted and that the whole visual experience is compromised. Main culprit is often wrong setup of the web browser or use of browser that cannot be setup to effectively manage colors (IE, Opera). </p>
<div class="note">
<div class="noteclassic">In general, the first part of troubleshooting color shifts is checking that our monitor is <a href="http://www.marcelpatek.com/monitor.html">calibrated and profiled</a>.</div>
</div>
<p>This post will guide you through the powerful options in Firefox that enable color management of images that are tagged with icc profile. If the image is not tagged with icc profile, its color interpretation will default to the computer system color space, which in most cases is close to sRGB<img class="centerinfo tool_tip" src="http://www.marcelpatek.com/blog/wp-content/themes/Carta/images/question_mark_icon.gif" alt="info" width="14" height="14" tooltip="Typical color space for web images."/> and and then converted to the monitor RGB. If the image is tagged with icc profile and if there is no monitor profile available, monitor RGB values are assumed and the monitor default profile is used for conversion. For calibrated and profiled or any decent monitor, results for tagged and untagged (but edited on standard sRGB gamut monitor) images will be just fine. However, troubles will most probably arise on a wide-gamut monitor.</p>
<p><span id="more-885"></span></p>
<p>Setup described below will ensure that most images from the Web will be faithfully displayed on your monitor, especially on wide-gamut monitors.</p>
<p style="padding-left: 30px;"><span style="font-size: medium;"><strong>Here is how to proceed (in Mozilla Firefox browser):</strong></span></p>
<ol>
<li>
<pre>Type "<span style="color: #000000;"><span style="background-color: #ffffff;">about:config</span></span>" in the browser address bar (no quotes).  <a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_1.png" rel="shadowbox[sbpost-885];player=img;" title="Step 1"><img class="aligncenter size-full wp-image-886" title="Step 1" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_1.png" alt="" width="200" height="34" /></a></pre>
</li>
<li>
<pre>Click the "<span style="color: #000000;"><span style="background-color: #ffffff;">OK, I'll be careful</span></span>" button in the warning message that appears.<a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_2.png" rel="shadowbox[sbpost-885];player=img;" title="Step 2"><img class="aligncenter size-full wp-image-887" title="Step 2" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_2.png" alt="" width="637" height="195" /></a></pre>
</li>
<li>
<pre>Type "<span style="background-color: #ffffff;">gfx</span>" to the Filter field.</pre>
</li>
<li>
<pre><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_3.png" rel="shadowbox[sbpost-885];player=img;" title="Step 3"><img class="aligncenter size-full wp-image-888" title="Step 3" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_3.png" alt="" width="197" height="108" /></a>Double-click the "<span style="color: #000000;"><span style="background-color: #ffffff;">gfx.color_management.display_profile</span></span>" line and enter path to your monitor profile.</pre>
</li>
</ol>
<div class="note">
<div class="notetip">If you do not know or do not have your monitor profile, just leave the default value. System will assume monitor RGB color space.</div>
</div>
<ol>
<li>
<pre>Double-click the "gfx.color_management.mode" line and enter "1" (means Full Color Management) in the box that opens up (click the image below to zoom in).<span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif; font-size: medium;"><a href="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_41.png" rel="shadowbox[sbpost-885];player=img;" title="Step 4"><img class="aligncenter size-full wp-image-927" title="Step 4" src="http://www.marcelpatek.com/blog/wp-content/uploads/2011/11/ff_41.png" alt="" width="600" height="106" /></a></span></pre>
</li>
<li>
<pre>Quit and restart Firefox.</pre>
</li>
</ol>
<pre> </pre>
<p>That&#8217;s it. Firefox should now display all images with full color management in action.</p>
<p><span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif; font-size: medium;"><br /> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/11/02/setting-the-full-color-management-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect iPad and iPhone in web browsers</title>
		<link>http://www.marcelpatek.com/blog/2011/10/09/code-to-recognize-ipad/</link>
		<comments>http://www.marcelpatek.com/blog/2011/10/09/code-to-recognize-ipad/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 18:32:45 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=673</guid>
		<description><![CDATA[In this short post, I will share a web page redirection code for users of iPad, iPhone or ipod who have no access to Adobe Flash media. In the first week of November 2011, Adobe announced that it will cease developing its Flash Player plug-in for mobile browsers. The next most affected devices(besides the iPad, [...]]]></description>
			<content:encoded><![CDATA[<p>In this short post, I will share a web page redirection code for users of iPad, iPhone or ipod who have no access to Adobe Flash media.</p>
<div class="note">
<div class="noteclassic">In the first week of November 2011, Adobe announced that it will cease developing its Flash Player plug-in for mobile browsers. The next most affected devices(besides the iPad, iPod, iPhone) are those based on Android OS.</div>
</div>
<p>Below is simple javascript that needs to be inserted into the top section of your web page (between the and tags) to re-direct those users to an alternative page.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;!--ipad redirect--&gt;
&lt;script language=javascript&gt;
if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1)
|| (navigator.userAgent.indexOf('iPad') != -1)) {
document.location = &quot;http://www.yourdomain.com/directory/index1.html&quot;;
}
&lt;/script&gt;
</pre>
<p>In this example, /directory/ is optional (in case that your site or iPad friedly version of your site resides in another directory) and index1.html is an alternative index.html that does not contain any Flash code. Index1.html is essentially a copy of the index.html where the Flash part is replaced with JQuery or html5 code to display the original slides or movie. It is where the visitor will be re-directed to.</p>
<p><span id="more-673"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/10/09/code-to-recognize-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making of this site</title>
		<link>http://www.marcelpatek.com/blog/2011/09/11/post-2/</link>
		<comments>http://www.marcelpatek.com/blog/2011/09/11/post-2/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 21:01:03 +0000</pubDate>
		<dc:creator>mpatek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.marcelpatek.com/blog/?p=8</guid>
		<description><![CDATA[Sometime in June 2011, I finally realized that I need to make a new home for all my photos, margin notes, web links, and code that I have created over the years.  Repeatedly, I found myself jotting down notes for image sizes, Lightroom settings, Photoshop configuration, camera settings, flash presets, &#8230; Overall, too many things [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime in June 2011, I finally realized that I need to make a new home for all my photos, margin notes, web links, and code that I have created over the years.  Repeatedly, I found myself jotting down notes for image sizes, Lightroom settings, Photoshop configuration, camera settings, flash presets, &#8230; Overall, too many things to remember. I also became unhappy with color management settings in the Adobe Flash, which rarely worked for me and which rendered my images too saturated on wide gamut monitors.</p>
<p>In the late July, a plan was born &#8211; build a site for the photos and other content that would keep them in one place with confidence in the original color quality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcelpatek.com/blog/2011/09/11/post-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

