<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Three algorithms for converting color to grayscale</title>
	<atom:link href="http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/</link>
	<description>The blog of John D. Cook</description>
	<lastBuildDate>Sat, 11 Feb 2012 22:42:11 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: &#187; Java color image to grayscale conversion algorithm(s) ZeroCool</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-125455</link>
		<dc:creator>&#187; Java color image to grayscale conversion algorithm(s) ZeroCool</dc:creator>
		<pubDate>Tue, 27 Dec 2011 00:07:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-125455</guid>
		<description>[...] max) max = pixel[i]; } return max; } } References:The article is based on the methods described in: http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale  [&#8617;]http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6 [&#8617;]Better [...]</description>
		<content:encoded><![CDATA[<p>[...] max) max = pixel[i]; } return max; } } References:The article is based on the methods described in: <a href="http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale " rel="nofollow">http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale </a> [&#8617;]http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6 [&#8617;]Better [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wineapp &#8211; creating a high-tech hash: gray scaling &#171; Mobile apps</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-120373</link>
		<dc:creator>Wineapp &#8211; creating a high-tech hash: gray scaling &#171; Mobile apps</dc:creator>
		<pubDate>Wed, 07 Dec 2011 22:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-120373</guid>
		<description>[...] I&#8217;ve found a great site explaining me all kinds of gray-scaling tricks. Naturally, I&#8217;ve chosen the luminosity [...]</description>
		<content:encoded><![CDATA[<p>[...] I&#8217;ve found a great site explaining me all kinds of gray-scaling tricks. Naturally, I&#8217;ve chosen the luminosity [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sham</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-108538</link>
		<dc:creator>sham</dc:creator>
		<pubDate>Mon, 17 Oct 2011 14:27:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-108538</guid>
		<description>sir, thanks a lot.wish u all the beat for your future work and hope u will always help us by providing such data.</description>
		<content:encoded><![CDATA[<p>sir, thanks a lot.wish u all the beat for your future work and hope u will always help us by providing such data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Weight Conversion</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-91058</link>
		<dc:creator>Weight Conversion</dc:creator>
		<pubDate>Sat, 02 Jul 2011 05:21:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-91058</guid>
		<description>n film or a digital sensor there is a spectral sensitivity function that determine which frequencies of light get absorbed.
_________
Allen</description>
		<content:encoded><![CDATA[<p>n film or a digital sensor there is a spectral sensitivity function that determine which frequencies of light get absorbed.<br />
_________<br />
Allen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don Stewart</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-82027</link>
		<dc:creator>Don Stewart</dc:creator>
		<pubDate>Mon, 16 May 2011 19:52:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-82027</guid>
		<description>I converted this nice example to Haskell as part of an multidimensional array programming tutorial. The result is pleasingly concise (and parallel).

http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Repa_Tutorial#Example:_parallel_image_desaturation</description>
		<content:encoded><![CDATA[<p>I converted this nice example to Haskell as part of an multidimensional array programming tutorial. The result is pleasingly concise (and parallel).</p>
<p><a href="http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Repa_Tutorial#Example:_parallel_image_desaturation" rel="nofollow">http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Repa_Tutorial#Example:_parallel_image_desaturation</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matej</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-77146</link>
		<dc:creator>Matej</dc:creator>
		<pubDate>Thu, 21 Apr 2011 08:55:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-77146</guid>
		<description>I did some testing with all three mentioned methods and discovered that Luminosity method is best if picture is not too blue. So I tried this:

1. for every pixel I first check if blue component is greater than green and red

2. if it IS I use Lightness method (or Average - both are good) ... if NOT I use Luminosity method for current pixel.

This algorithm gives very good results. It comes very close to Photoshop&#039;s convert to Grayscale &quot;mystic&quot; algorithm :)</description>
		<content:encoded><![CDATA[<p>I did some testing with all three mentioned methods and discovered that Luminosity method is best if picture is not too blue. So I tried this:</p>
<p>1. for every pixel I first check if blue component is greater than green and red</p>
<p>2. if it IS I use Lightness method (or Average &#8211; both are good) &#8230; if NOT I use Luminosity method for current pixel.</p>
<p>This algorithm gives very good results. It comes very close to Photoshop&#8217;s convert to Grayscale &#8220;mystic&#8221; algorithm <img src='http://www.johndcook.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Ransom</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-50103</link>
		<dc:creator>Mark Ransom</dc:creator>
		<pubDate>Fri, 29 Oct 2010 17:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-50103</guid>
		<description>The &quot;magic numbers&quot; for luminosity are slightly rounded versions of the ones in BT.709 for HDTV: http://en.wikipedia.org/wiki/YUV#BT.709_and_BT.601

There appears to be a bug, the weights should add up to 1.0. I think the multiplier for G should be 0.72 rather than 0.71.

As for how B/W film converts to gray, it appears to depend on the exact film chemistry: http://en.wikipedia.org/wiki/Photographic_film#Spectral_sensitivity</description>
		<content:encoded><![CDATA[<p>The &#8220;magic numbers&#8221; for luminosity are slightly rounded versions of the ones in BT.709 for HDTV: <a href="http://en.wikipedia.org/wiki/YUV#BT.709_and_BT.601" rel="nofollow">http://en.wikipedia.org/wiki/YUV#BT.709_and_BT.601</a></p>
<p>There appears to be a bug, the weights should add up to 1.0. I think the multiplier for G should be 0.72 rather than 0.71.</p>
<p>As for how B/W film converts to gray, it appears to depend on the exact film chemistry: <a href="http://en.wikipedia.org/wiki/Photographic_film#Spectral_sensitivity" rel="nofollow">http://en.wikipedia.org/wiki/Photographic_film#Spectral_sensitivity</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CreativeNotice</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-48075</link>
		<dc:creator>CreativeNotice</dc:creator>
		<pubDate>Thu, 07 Oct 2010 21:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-48075</guid>
		<description>Thanks for the post. Was exactly what I was looking for.</description>
		<content:encoded><![CDATA[<p>Thanks for the post. Was exactly what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paweł Głowacki : Converting to grayscale with TBitmap.ScanLine property</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-36413</link>
		<dc:creator>Paweł Głowacki : Converting to grayscale with TBitmap.ScanLine property</dc:creator>
		<pubDate>Thu, 15 Apr 2010 10:45:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-36413</guid>
		<description>[...] I have described an algorithm for converting arbitrary TBitmap instances to gray using a selected formula. The problem is with the performance of the code that actually changes the color of each pixel. [...]</description>
		<content:encoded><![CDATA[<p>[...] I have described an algorithm for converting arbitrary TBitmap instances to gray using a selected formula. The problem is with the performance of the code that actually changes the color of each pixel. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paweł Głowacki : Boian&#8217;s TBitmap Visualizer and converting to grayscale</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-35526</link>
		<dc:creator>Paweł Głowacki : Boian&#8217;s TBitmap Visualizer and converting to grayscale</dc:creator>
		<pubDate>Mon, 29 Mar 2010 08:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-35526</guid>
		<description>[...] clicks away I have found the description of three algorithms to convert to grayscale as implemented by GIMP: lightness, average and luminosity. All these formulas take R, G and B [...]</description>
		<content:encoded><![CDATA[<p>[...] clicks away I have found the description of three algorithms to convert to grayscale as implemented by GIMP: lightness, average and luminosity. All these formulas take R, G and B [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ant.simianzombie.com &#187; Scrollbars and Greyscale Algorithms</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-27767</link>
		<dc:creator>ant.simianzombie.com &#187; Scrollbars and Greyscale Algorithms</dc:creator>
		<pubDate>Mon, 23 Nov 2009 23:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-27767</guid>
		<description>[...] the properties of the human eye. Other algorithms for this are listed on John D Cook&#8217;s blog.    Categories: Woopsi Tags: Algorithms, bugfixes, greyscale, scrollbars, Woopsi        Comments [...]</description>
		<content:encoded><![CDATA[<p>[...] the properties of the human eye. Other algorithms for this are listed on John D Cook&#8217;s blog.    Categories: Woopsi Tags: Algorithms, bugfixes, greyscale, scrollbars, Woopsi        Comments [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: igorbrejc.net &#187; Fresh Catch For August 29th</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-23650</link>
		<dc:creator>igorbrejc.net &#187; Fresh Catch For August 29th</dc:creator>
		<pubDate>Sat, 29 Aug 2009 13:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-23650</guid>
		<description>[...] Three algorithms for converting color to grayscale &#8212; The Endeavour [...]</description>
		<content:encoded><![CDATA[<p>[...] Three algorithms for converting color to grayscale &mdash; The Endeavour [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PossiblyKevin</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-23466</link>
		<dc:creator>PossiblyKevin</dc:creator>
		<pubDate>Tue, 25 Aug 2009 08:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-23466</guid>
		<description>the answer is none of the above methods are used for film. in film or any system sensitive to the electromagnetic spectrum, can be considered as a reduction of an infinite number of frequencies (well infinite depending on your quantum view of the world I guess), into a smaller number, in a similar manner to a weighted sum histogram.

In film or a digital sensor there is a spectral sensitivity function that determine which frequencies  of light get absorbed/sensitise the emulsion based upon the chemical structure. Through various means this gets converted to either silver halide crystals or in colour film different dye&#039;s are formed (eventually).

You then shine a light through the resultant film and bounce it off a screen, your eyes then view the result, In mathematical terms this is a highly non-linear transformation from scene-to-screen and is a function of many reductions from spectral to n-dimensional &#039;records&#039; all of whose intensity functions are non-linear.

In film the actual &#039;colours&#039; vary mostly due to the stocks used, but there are some effects that vary with intensity of exposure so the camera settings can effect the results though this is minor compared to the stock and development.

Re: the magic numbers, well they are based upon a mixing assumption. They are are saying what linear combination of R, G and B would you perceive as being without colour, i.e. neutral. Depending on the exact colours of R, G and B you will get different proportions. The mixing also assumes that the individual colour channels are linear, else your not really that close to how our eyes behave. What you consider neutral is also heavily effected by the surroundings in which you view, your eyes are able to adjust their own gain functions to compensate for a certain amount of change, thus a piece of paper can look white to you even if the colour of the light  shining on it is changed, although with highly coloured light you will still see it as being coloured.</description>
		<content:encoded><![CDATA[<p>the answer is none of the above methods are used for film. in film or any system sensitive to the electromagnetic spectrum, can be considered as a reduction of an infinite number of frequencies (well infinite depending on your quantum view of the world I guess), into a smaller number, in a similar manner to a weighted sum histogram.</p>
<p>In film or a digital sensor there is a spectral sensitivity function that determine which frequencies  of light get absorbed/sensitise the emulsion based upon the chemical structure. Through various means this gets converted to either silver halide crystals or in colour film different dye&#8217;s are formed (eventually).</p>
<p>You then shine a light through the resultant film and bounce it off a screen, your eyes then view the result, In mathematical terms this is a highly non-linear transformation from scene-to-screen and is a function of many reductions from spectral to n-dimensional &#8216;records&#8217; all of whose intensity functions are non-linear.</p>
<p>In film the actual &#8216;colours&#8217; vary mostly due to the stocks used, but there are some effects that vary with intensity of exposure so the camera settings can effect the results though this is minor compared to the stock and development.</p>
<p>Re: the magic numbers, well they are based upon a mixing assumption. They are are saying what linear combination of R, G and B would you perceive as being without colour, i.e. neutral. Depending on the exact colours of R, G and B you will get different proportions. The mixing also assumes that the individual colour channels are linear, else your not really that close to how our eyes behave. What you consider neutral is also heavily effected by the surroundings in which you view, your eyes are able to adjust their own gain functions to compensate for a certain amount of change, thus a piece of paper can look white to you even if the colour of the light  shining on it is changed, although with highly coloured light you will still see it as being coloured.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-23457</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 25 Aug 2009 02:20:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-23457</guid>
		<description>@Keith: That&#039;s a good question. I&#039;d like to know the answer.</description>
		<content:encoded><![CDATA[<p>@Keith: That&#8217;s a good question. I&#8217;d like to know the answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-23456</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Tue, 25 Aug 2009 02:15:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-23456</guid>
		<description>Perhaps this is obvious to others, but what algorithm does actual film &quot;use&quot; to convert colors? An old-school analog (i.e. not digital) camera changes real world colors into b&amp;w photographs, but using which of these methods, if any? I&#039;m guessing it may vary with camera and film settings, and likely has changed over time, but is there one method it tends to favor over the others?</description>
		<content:encoded><![CDATA[<p>Perhaps this is obvious to others, but what algorithm does actual film &#8220;use&#8221; to convert colors? An old-school analog (i.e. not digital) camera changes real world colors into b&amp;w photographs, but using which of these methods, if any? I&#8217;m guessing it may vary with camera and film settings, and likely has changed over time, but is there one method it tends to favor over the others?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AdamJTP</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-23431</link>
		<dc:creator>AdamJTP</dc:creator>
		<pubDate>Mon, 24 Aug 2009 15:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-23431</guid>
		<description>And if (0.21 R + 0.71 G + 0.07 B) seem like magic numbers then here are some more magic numbers: 
&lt;a href=&quot;http://jscience.org/experimental/javadoc/org/jscience/computing/ai/vision/GreyscaleFilter.html&quot; rel=&quot;nofollow&quot;&gt;http://jscience.org/experimental/javadoc/org/jscience/computing/ai/vision/GreyscaleFilter.html&lt;/a&gt;

I&#039;ve heard that some portrait photographers use orange filters with black and white film (to remove freckles and spots).</description>
		<content:encoded><![CDATA[<p>And if (0.21 R + 0.71 G + 0.07 B) seem like magic numbers then here are some more magic numbers:<br />
<a href="http://jscience.org/experimental/javadoc/org/jscience/computing/ai/vision/GreyscaleFilter.html" rel="nofollow">http://jscience.org/experimental/javadoc/org/jscience/computing/ai/vision/GreyscaleFilter.html</a></p>
<p>I&#8217;ve heard that some portrait photographers use orange filters with black and white film (to remove freckles and spots).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Howe</title>
		<link>http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/comment-page-1/#comment-23430</link>
		<dc:creator>Colin Howe</dc:creator>
		<pubDate>Mon, 24 Aug 2009 15:19:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=2916#comment-23430</guid>
		<description>Always worth just seeing if each channel on it&#039;s own produces good results too! Can also get some really interesting shots when just looking at one channel :-)</description>
		<content:encoded><![CDATA[<p>Always worth just seeing if each channel on it&#8217;s own produces good results too! Can also get some really interesting shots when just looking at one channel <img src='http://www.johndcook.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.405 seconds -->

