<?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>MikeLin.ca &#187; iPhone</title>
	<atom:link href="http://www.mikelin.ca/blog/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikelin.ca/blog</link>
	<description>The Blog Lives</description>
	<lastBuildDate>Wed, 06 Oct 2010 18:04:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>iPhone: Splitting images into tiles for faster loading with ImageMagick</title>
		<link>http://www.mikelin.ca/blog/2010/06/iphone-splitting-image-into-tiles-for-faster-loading-with-imagemagick/</link>
		<comments>http://www.mikelin.ca/blog/2010/06/iphone-splitting-image-into-tiles-for-faster-loading-with-imagemagick/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 01:19:29 +0000</pubDate>
		<dc:creator>Mike Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.mikelin.ca/blog/?p=206</guid>
		<description><![CDATA[iPhone developers! I found an easy and automated way to cut an image up into tiles at different zoom scales for the purpose of UIScrollView image tiling as shown in Apple&#8217;s ScrollViewSuite sample code! Just get imageMagick, a command line image editor you can get from MacPorts. I made a bash script to automatically resize [...]]]></description>
			<content:encoded><![CDATA[<p>iPhone developers! I found an easy and automated way to cut an image up into tiles at different zoom scales for the purpose of UIScrollView image tiling as shown in Apple&#8217;s <a href="http://developer.apple.com/iphone/library/samplecode/ScrollViewSuite/Introduction/Intro.html">ScrollViewSuite</a> sample code!</p>
<p>Just get imageMagick, a command line image editor you can get from MacPorts. I made a bash script to automatically resize and tile at 100%, 50% and 25% resolutions.</p>
<p>tile.sh:<br />
<code>#!/bin/bash<br />
file=$1<br />
function tile() {<br />
convert $file -scale ${s}%x -crop 256x256 \<br />
    -set filename:tile "%[fx:page.x/256]_%[fx:page.y/256]" \<br />
    +repage +adjoin "${file%.*}_${s}_%[filename:tile].${file#*.}"<br />
}<br />
s=100<br />
tile<br />
s=50<br />
tile<br />
s=25<br />
tile</code></p>
<p>If you run: <code>tile.sh bigimage.jpg</code> it&#8217;ll dump out 256&#215;256 sized tiles called bigimage_100_0_0.jpg, bigimage_100_0_1.jpg etc for each tile at 100% scale, as well as bigimage_50_0_0.jpg et al at 50% scale etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikelin.ca/blog/2010/06/iphone-splitting-image-into-tiles-for-faster-loading-with-imagemagick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
