<?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: What Color is My Pixel? Image based color picker on iPhone</title>
	<atom:link href="http://www.markj.net/iphone-uiimage-pixel-color/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markj.net/iphone-uiimage-pixel-color/</link>
	<description>iPhone App Development &#38; Consulting</description>
	<lastBuildDate>Sun, 07 Mar 2010 04:11:13 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pinkroad &#187; Blog Archive &#187; pixel RGB value</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2171</link>
		<dc:creator>pinkroad &#187; Blog Archive &#187; pixel RGB value</dc:creator>
		<pubDate>Sat, 06 Mar 2010 10:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2171</guid>
		<description>[...] http://www.markj.net/iphone-uiimage-pixel-color/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.markj.net/iphone-uiimage-pixel-color/" rel="nofollow">http://www.markj.net/iphone-uiimage-pixel-color/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2159</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 22 Feb 2010 00:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2159</guid>
		<description>Carl, Great suggestion to deal with scaling!

For those who are wondering, the additional code looks like this.  I didn&#039;t accomodate image offset since my image takes up the entire view.  YMMV.  My image was smaller than my frame.  You might have to flip the division if your ratio is the opposite.

size_t w = CGImageGetWidth(inImage);  //Written by Mark
size_t h = CGImageGetHeight(inImage); //Written by Mark
float xscale = w / self.frame.size.width;
float yscale = h / self.frame.size.height;
point.x = point.x * xscale;
point.y = point.y * yscale;</description>
		<content:encoded><![CDATA[<p>Carl, Great suggestion to deal with scaling!</p>
<p>For those who are wondering, the additional code looks like this.  I didn&#8217;t accomodate image offset since my image takes up the entire view.  YMMV.  My image was smaller than my frame.  You might have to flip the division if your ratio is the opposite.</p>
<p>size_t w = CGImageGetWidth(inImage);  //Written by Mark<br />
size_t h = CGImageGetHeight(inImage); //Written by Mark<br />
float xscale = w / self.frame.size.width;<br />
float yscale = h / self.frame.size.height;<br />
point.x = point.x * xscale;<br />
point.y = point.y * yscale;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2083</link>
		<dc:creator>Carl</dc:creator>
		<pubDate>Fri, 11 Dec 2009 12:43:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2083</guid>
		<description>Mark,

Looks great.  I also found another color picker at http://www.v-vent.com/blog/?p=27 which might be able to be combined to have a pointer on the screen to show what pixel is being examined in the image.

A comment on scaling for those who have asked about it.  You should be able to take the x,y of the current touch, subtract any offset to match the image frame, then scale the x,y point by the inverse scaling factor from the image in memory to the screen image, which should point to the correct pixel in the original unscaled image.

It only becomes a problem if you allow the user to modify the scaling factor by pinching the image, which then means you have to do a little more work to find out what part of the image is being displayed, and how it fits into the original image.

Great post!  And thanks, Mark, for the re-usable class.</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>Looks great.  I also found another color picker at <a href="http://www.v-vent.com/blog/?p=27" rel="nofollow">http://www.v-vent.com/blog/?p=27</a> which might be able to be combined to have a pointer on the screen to show what pixel is being examined in the image.</p>
<p>A comment on scaling for those who have asked about it.  You should be able to take the x,y of the current touch, subtract any offset to match the image frame, then scale the x,y point by the inverse scaling factor from the image in memory to the screen image, which should point to the correct pixel in the original unscaled image.</p>
<p>It only becomes a problem if you allow the user to modify the scaling factor by pinching the image, which then means you have to do a little more work to find out what part of the image is being displayed, and how it fits into the original image.</p>
<p>Great post!  And thanks, Mark, for the re-usable class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Usman Munier</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2069</link>
		<dc:creator>Usman Munier</dc:creator>
		<pubDate>Mon, 02 Nov 2009 12:23:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2069</guid>
		<description>Mark,

it was a nice article, mark can we also set the color of the pixel ?? i m trying to do that but still not able to find out the way in Quartz2d. your help would highly be appriciated.

Regards,
Usman</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>it was a nice article, mark can we also set the color of the pixel ?? i m trying to do that but still not able to find out the way in Quartz2d. your help would highly be appriciated.</p>
<p>Regards,<br />
Usman</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed Olsen</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2063</link>
		<dc:creator>Reed Olsen</dc:creator>
		<pubDate>Mon, 19 Oct 2009 01:56:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2063</guid>
		<description>Just an FYI - I used XCode&#039;s static analyzer on my project, and got the following warnings:

CGContextRelease(cgctx); 
Incorrect decrement of the reference count of an object is not owned at this point by the caller

and

return context;
Potential leak of an object allocated on line 116 and stored into &#039;context&#039;

Quite frankly, I haven&#039;t messed around with much CoreGraphics stuff, and this is gibberish to me, but I thought I&#039;d let you know.

Again, I appreciate you sharing this bit of code with us. Thanks!</description>
		<content:encoded><![CDATA[<p>Just an FYI &#8211; I used XCode&#8217;s static analyzer on my project, and got the following warnings:</p>
<p>CGContextRelease(cgctx);<br />
Incorrect decrement of the reference count of an object is not owned at this point by the caller</p>
<p>and</p>
<p>return context;<br />
Potential leak of an object allocated on line 116 and stored into &#8216;context&#8217;</p>
<p>Quite frankly, I haven&#8217;t messed around with much CoreGraphics stuff, and this is gibberish to me, but I thought I&#8217;d let you know.</p>
<p>Again, I appreciate you sharing this bit of code with us. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed Olsen</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2060</link>
		<dc:creator>Reed Olsen</dc:creator>
		<pubDate>Wed, 14 Oct 2009 08:12:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2060</guid>
		<description>Awesome stuff - you just saved me a few hours.</description>
		<content:encoded><![CDATA[<p>Awesome stuff &#8211; you just saved me a few hours.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2030</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 18 Aug 2009 00:53:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2030</guid>
		<description>Have you found a way to do the pixel color with a scaled down image?  I am trying to take a picture of something, and then click the image and get the color....any ideas on how to manage the scaling?  I am trying to determine an algorithm for changing the &quot;width&quot; based on the scale....you think something like that would work?

Thanks! Code is great, like the port from the Apple sample code. Very cool stuff.</description>
		<content:encoded><![CDATA[<p>Have you found a way to do the pixel color with a scaled down image?  I am trying to take a picture of something, and then click the image and get the color&#8230;.any ideas on how to manage the scaling?  I am trying to determine an algorithm for changing the &#8220;width&#8221; based on the scale&#8230;.you think something like that would work?</p>
<p>Thanks! Code is great, like the port from the Apple sample code. Very cool stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tuannd</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-2025</link>
		<dc:creator>Tuannd</dc:creator>
		<pubDate>Fri, 07 Aug 2009 09:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-2025</guid>
		<description>Awesome, THANKS A LOT. You&#039;re so AMAZING</description>
		<content:encoded><![CDATA[<p>Awesome, THANKS A LOT. You&#8217;re so AMAZING</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sébastien</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-1992</link>
		<dc:creator>Sébastien</dc:creator>
		<pubDate>Tue, 07 Jul 2009 14:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-1992</guid>
		<description>Hi, Thanks for your post, excellent job. Have you an example how to create a new UIImage from the modified data ?</description>
		<content:encoded><![CDATA[<p>Hi, Thanks for your post, excellent job. Have you an example how to create a new UIImage from the modified data ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hassanvfx</title>
		<link>http://www.markj.net/iphone-uiimage-pixel-color/comment-page-1/#comment-1967</link>
		<dc:creator>hassanvfx</dc:creator>
		<pubDate>Thu, 11 Jun 2009 03:27:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.markj.net/?p=245#comment-1967</guid>
		<description>version 3.0 on iphone frameworks is given me some erros so simple replace this line	

        colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);

by this one

	colorSpace = CGColorSpaceCreateDeviceRGB();

thanks master is a great contribution.</description>
		<content:encoded><![CDATA[<p>version 3.0 on iphone frameworks is given me some erros so simple replace this line	</p>
<p>        colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);</p>
<p>by this one</p>
<p>	colorSpace = CGColorSpaceCreateDeviceRGB();</p>
<p>thanks master is a great contribution.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
