<?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: Image Processing Tricks</title>
	<atom:link href="http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks</link>
	<description>Tips and Tricks for iPhone, iPod, iPad and iOS Developers</description>
	<lastBuildDate>Tue, 17 Apr 2012 16:54:31 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: bob</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-23417</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Thu, 12 Apr 2012 00:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-23417</guid>
		<description>i want to allow the app user, to add his face on famous celebrities bodies, and then save the image to camera roll?how can i do that? any ideas?</description>
		<content:encoded><![CDATA[<p>i want to allow the app user, to add his face on famous celebrities bodies, and then save the image to camera roll?how can i do that? any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason TEPOORTEN</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-20554</link>
		<dc:creator>Jason TEPOORTEN</dc:creator>
		<pubDate>Sun, 12 Feb 2012 07:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-20554</guid>
		<description>Hi Mark,

Here is an adaptation of the routine that can be used for @2x images.

I have written it based on the sources I make reference to, including this page; thus please note the URL REF comments.

// BEGIN CODE


- (UIImage*) mergeTwoImages : (UIImage*) topImage : (UIImage*) bottomImage {
	// URL REF: http://iphoneincubator.com/blog/windows-views/image-processing-tricks
	// URL REF: http://stackoverflow.com/questions/1309757/blend-two-uiimages?answertab=active#tab-top
	// URL REF: http://www.waterworld.com.hk/en/blog/uigraphicsbeginimagecontext-and-retina-display

	int width = bottomImage.size.width;
	int height = bottomImage.size.height;

	CGSize newSize = CGSizeMake(width, height);
	static CGFloat scale = -1.0;
    if (scale= 4.0) {
            scale = [screen scale];
        }
        else {
            scale = 0.0;	// Use the standard API
        }
    }
    if (scale&gt;0.0) {
        UIGraphicsBeginImageContextWithOptions(newSize, NO, scale);
    }
    else {
        UIGraphicsBeginImageContext(newSize);
    }

	[bottomImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
	[topImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height) blendMode:kCGBlendModeNormal alpha:1.0];

	UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
	UIGraphicsEndImageContext();

	return newImage;
}

// END CODE</description>
		<content:encoded><![CDATA[<p>Hi Mark,</p>
<p>Here is an adaptation of the routine that can be used for @2x images.</p>
<p>I have written it based on the sources I make reference to, including this page; thus please note the URL REF comments.</p>
<p>// BEGIN CODE</p>
<p>- (UIImage*) mergeTwoImages : (UIImage*) topImage : (UIImage*) bottomImage {<br />
	// URL REF: <a href="http://iphoneincubator.com/blog/windows-views/image-processing-tricks" rel="nofollow">http://iphoneincubator.com/blog/windows-views/image-processing-tricks</a><br />
	// URL REF: <a href="http://stackoverflow.com/questions/1309757/blend-two-uiimages?answertab=active#tab-top" rel="nofollow">http://stackoverflow.com/questions/1309757/blend-two-uiimages?answertab=active#tab-top</a><br />
	// URL REF: <a href="http://www.waterworld.com.hk/en/blog/uigraphicsbeginimagecontext-and-retina-display" rel="nofollow">http://www.waterworld.com.hk/en/blog/uigraphicsbeginimagecontext-and-retina-display</a></p>
<p>	int width = bottomImage.size.width;<br />
	int height = bottomImage.size.height;</p>
<p>	CGSize newSize = CGSizeMake(width, height);<br />
	static CGFloat scale = -1.0;<br />
    if (scale= 4.0) {<br />
            scale = [screen scale];<br />
        }<br />
        else {<br />
            scale = 0.0;	// Use the standard API<br />
        }<br />
    }<br />
    if (scale&gt;0.0) {<br />
        UIGraphicsBeginImageContextWithOptions(newSize, NO, scale);<br />
    }<br />
    else {<br />
        UIGraphicsBeginImageContext(newSize);<br />
    }</p>
<p>	[bottomImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];<br />
	[topImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height) blendMode:kCGBlendModeNormal alpha:1.0];</p>
<p>	UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();<br />
	UIGraphicsEndImageContext();</p>
<p>	return newImage;<br />
}</p>
<p>// END CODE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-14908</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 01 Nov 2011 14:48:35 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-14908</guid>
		<description>Great tips!  Regarding the function 

- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 

It seems like this works perfectly on simulator and 320x480 screens, but if you jump to 640x960, image2&#039;s dimensions are calculated at 320x480 sizes (even if you have the @2x file ready).  This is only happening for image2; image1 is calculated at the correct Retina size.  Curious.</description>
		<content:encoded><![CDATA[<p>Great tips!  Regarding the function </p>
<p>- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 </p>
<p>It seems like this works perfectly on simulator and 320&#215;480 screens, but if you jump to 640&#215;960, image2&#8217;s dimensions are calculated at 320&#215;480 sizes (even if you have the @2x file ready).  This is only happening for image2; image1 is calculated at the correct Retina size.  Curious.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-14965</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 22 Jul 2011 23:33:48 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-14965</guid>
		<description>@Hakimo: The resulting image is returned from the addImage: method. You can use this in any way that you would normally use an UIImage object.</description>
		<content:encoded><![CDATA[<p>@Hakimo: The resulting image is returned from the addImage: method. You can use this in any way that you would normally use an UIImage object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hakimo</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-12699</link>
		<dc:creator>Hakimo</dc:creator>
		<pubDate>Thu, 21 Jul 2011 04:20:27 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-12699</guid>
		<description>Hi, I&#039;m not sure I understand how to combine the two images. I tried testing the code in my method file but how to I call the resulting image? Is there an xcode example for this?

Thanks</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m not sure I understand how to combine the two images. I tried testing the code in my method file but how to I call the resulting image? Is there an xcode example for this?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-14967</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sat, 25 Jun 2011 23:46:35 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-14967</guid>
		<description>@Sal: The method name &quot;imageSavedToPhotosAlbum:&quot; is arbitrary, but it must exist in your code because this method will be called when UIImageWriteToSavedPhotosAlbum completes. Other code examples may use the method name &quot;image:&quot;. This is just as valid. I just happen to like very long, descriptive method names.
The context parameter is only passed back to your method defined in the @selector. You can pass in the name of the image saved or some other information that might be useful in the called method. If you don&#039;t want any such information to be passed back to your code, then pass nil to the UIImageWriteToSavedPhotosAlbum function.</description>
		<content:encoded><![CDATA[<p>@Sal: The method name &#8220;imageSavedToPhotosAlbum:&#8221; is arbitrary, but it must exist in your code because this method will be called when UIImageWriteToSavedPhotosAlbum completes. Other code examples may use the method name &#8220;image:&#8221;. This is just as valid. I just happen to like very long, descriptive method names.<br />
The context parameter is only passed back to your method defined in the @selector. You can pass in the name of the image saved or some other information that might be useful in the called method. If you don&#8217;t want any such information to be passed back to your code, then pass nil to the UIImageWriteToSavedPhotosAlbum function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sal Aguinaga</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-12117</link>
		<dc:creator>Sal Aguinaga</dc:creator>
		<pubDate>Sat, 25 Jun 2011 11:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-12117</guid>
		<description>Regarding: `UIImageWriteToSavedPhotosAlbum(image, self, @selector(imageSavedToPhotosAlbum: didFinishSavingWithError: contextInfo:), context);` 
I&#039;ve seen many examples showing: `UIImageWriteToSavedPhotosAlbum(imageCopy, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);`

so I replaced `image` with `imageSavedToPhotosAlbum`, but it complained that `context`, which is at the end of your line, is an undeclared identifier.  If I replace it with nil, the app crashes returning the following error: *** Terminating app due to uncaught exception &#039;NSInvalidArgumentException&#039;, reason: &#039;+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil&#039;  I&#039;m using ios 4.3.3 and Xcode 4.0.2.  Any suggestions?</description>
		<content:encoded><![CDATA[<p>Regarding: `UIImageWriteToSavedPhotosAlbum(image, self, @selector(imageSavedToPhotosAlbum: didFinishSavingWithError: contextInfo:), context);`<br />
I&#8217;ve seen many examples showing: `UIImageWriteToSavedPhotosAlbum(imageCopy, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);`</p>
<p>so I replaced `image` with `imageSavedToPhotosAlbum`, but it complained that `context`, which is at the end of your line, is an undeclared identifier.  If I replace it with nil, the app crashes returning the following error: *** Terminating app due to uncaught exception &#8216;NSInvalidArgumentException&#8217;, reason: &#8216;+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil&#8217;  I&#8217;m using ios 4.3.3 and Xcode 4.0.2.  Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oded Ben Dov</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-7579</link>
		<dc:creator>Oded Ben Dov</dc:creator>
		<pubDate>Mon, 10 Jan 2011 21:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-7579</guid>
		<description>There&#039;s a project that achieves fast image processing from the video camera, that is open source. It can help start anyone in the right direction - 
http://www.hatzlaha.co.il/150842/FAST-Corner-V2

Thanks! :)</description>
		<content:encoded><![CDATA[<p>There&#8217;s a project that achieves fast image processing from the video camera, that is open source. It can help start anyone in the right direction &#8211;<br />
<a href="http://www.hatzlaha.co.il/150842/FAST-Corner-V2" rel="nofollow">http://www.hatzlaha.co.il/150842/FAST-Corner-V2</a></p>
<p>Thanks! <img src='http://iPhoneIncubator.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rikza Azriyan</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-7104</link>
		<dc:creator>Rikza Azriyan</dc:creator>
		<pubDate>Sat, 18 Dec 2010 10:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-7104</guid>
		<description>Nica share....
Btw, i ever compile opencv on the iphone simulator. It was wonderfull, but lil bit confusing me to convert betwen UIImage to Iplimage and vice versa, and some of the rule of instant method parameter. So i tried to find another way to did it..
I have one question, can use CGImage Class to do image processing in realtime like opencv did?
Thx b4</description>
		<content:encoded><![CDATA[<p>Nica share&#8230;.<br />
Btw, i ever compile opencv on the iphone simulator. It was wonderfull, but lil bit confusing me to convert betwen UIImage to Iplimage and vice versa, and some of the rule of instant method parameter. So i tried to find another way to did it..<br />
I have one question, can use CGImage Class to do image processing in realtime like opencv did?<br />
Thx b4</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shiki</title>
		<link>http://iPhoneIncubator.com/blog/windows-views/image-processing-tricks/comment-page-1#comment-6422</link>
		<dc:creator>Shiki</dc:creator>
		<pubDate>Wed, 17 Nov 2010 12:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=111#comment-6422</guid>
		<description>Thanks for the info on handling UIImageWriteToSavedPhotosAlbum.</description>
		<content:encoded><![CDATA[<p>Thanks for the info on handling UIImageWriteToSavedPhotosAlbum.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 5/15 queries in 0.017 seconds using disk: basic
Object Caching 360/364 objects using disk: basic

Served from: iphoneincubator.com @ 2012-05-21 06:38:22 -->
