<?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>jonls devblog</title>
	<atom:link href="http://jonls.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonls.dk</link>
	<description>Jon Lund Steffensen</description>
	<lastBuildDate>Fri, 13 Apr 2012 10:00:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Freeserf code is up</title>
		<link>http://jonls.dk/2011/09/freeserf-code-is-up/</link>
		<comments>http://jonls.dk/2011/09/freeserf-code-is-up/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 22:59:14 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[gpl]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[remake]]></category>
		<category><![CDATA[serf city]]></category>
		<category><![CDATA[settlers]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=224</guid>
		<description><![CDATA[I just decided to release all the code for my Settlers 1 clone to GitHub. You can find more info here. It&#8217;s working, and semi-playable, but still pretty far from the full experience. I don&#8217;t know if I&#8217;ll ever get &#8230; <a href="http://jonls.dk/2011/09/freeserf-code-is-up/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just decided to release all the code for my Settlers 1 clone to GitHub. You can find <a href="http://jonls.dk/freeserf/">more info here</a>. It&#8217;s working, and semi-playable, but still pretty far from the full experience. I don&#8217;t know if I&#8217;ll ever get time to finish it, but at least now someone also can pick it up and hopefully do something nice with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2011/09/freeserf-code-is-up/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Redshift 1.7</title>
		<link>http://jonls.dk/2011/07/redshift-1-7/</link>
		<comments>http://jonls.dk/2011/07/redshift-1-7/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 13:44:45 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Redshift]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[gpl]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[redshift]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=202</guid>
		<description><![CDATA[I finally had some time to throw a new release of Redshift together. The most important change, for most of you, is probably the Geoclue location provider by Mathieu Trudel-Lapierre. The old GNOME clock location provider has stopped working for &#8230; <a href="http://jonls.dk/2011/07/redshift-1-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I finally had some time to throw a new release of <a href="http://jonls.dk/redshift/">Redshift</a> together. The most important change, for most of you, is probably the <a href="http://freedesktop.org/wiki/Software/GeoClue">Geoclue</a> location provider by Mathieu Trudel-Lapierre. The old GNOME clock location provider has stopped working for many, as Ubuntu no longer includes a clock applet in the unity desktop. This is fixed now with this new location provider, which should work right out-of-the-box on Ubuntu Natty systems.</p>
<p>Other news are:</p>
<ul>
<li>Allow brightness to be adjusted (-b).</li>
<li>Provide option to set color temperature directly (Joe Hillenbrand).</li>
<li>Add option to show program version (-V).</li>
<li>Add configure.ac option to install ubuntu icons. They will no longer be installed by default (Francesco Marella).</li>
<li>config: Look in %userprofile%/.config/redshift.conf on windows platform.</li>
<li>Fix: w32gdi: Obtain a new DC handle on every adjustment. This fixes a bug where redshift stops updating the screen.</li>
</ul>
<p><a href="https://flattr.com/submit/auto?title=Redshift 1.7&url=http://jonls.dk/redshift/&category=text"><img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2011/07/redshift-1-7/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>More free software to flattr</title>
		<link>http://jonls.dk/2010/11/more-free-software-to-flattr/</link>
		<comments>http://jonls.dk/2010/11/more-free-software-to-flattr/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 07:08:34 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[flattr]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=178</guid>
		<description><![CDATA[So you&#8217;ve just created a Flattr account and now you can&#8217;t find anything to flattr? Are you using free software every day? Raphaël Hertzog (of Debian fame) is running a monthly Flattr FOSS newsletter where he recommends free software to flattr. &#8230; <a href="http://jonls.dk/2010/11/more-free-software-to-flattr/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-196 alignright" title="Flattr logo" src="http://jonls.dk/wp-content/uploads/flattr_logo-287x300.jpg" alt="" width="201" height="210" /></p>
<p>So you&#8217;ve just created a Flattr account and now you can&#8217;t find anything to flattr? Are you using free software every day? Raphaël Hertzog (of Debian fame) is running a monthly <a href="http://raphaelhertzog.com/flattr-foss/">Flattr FOSS newsletter</a> where he recommends free software to flattr. You can see <a href="http://raphaelhertzog.com/category/flattr/">all the previous newsletter posts here</a>.</p>
<p>If you don&#8217;t know what Flattr is, have a look <a href="http://www.youtube.com/watch?v=9zrMlEEWBgY">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/11/more-free-software-to-flattr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AccurateRip tools</title>
		<link>http://jonls.dk/2010/10/accuraterip-tools/</link>
		<comments>http://jonls.dk/2010/10/accuraterip-tools/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 23:44:34 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[accuraterip]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=179</guid>
		<description><![CDATA[I have made some tools for calculating AccurateRip checksums as described here available here: http://github.com/jonls/accuraterip-tools. There is also a tool in the repository for calculating the kind of CRC32 that is included in EAC log files. <a href="http://jonls.dk/2010/10/accuraterip-tools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have made some tools for calculating AccurateRip checksums <a href="http://jonls.dk/2009/10/calculating-accuraterip-checksums/">as described here</a> available here: <a href="http://github.com/jonls/accuraterip-tools">http://github.com/jonls/accuraterip-tools</a>. There is also a tool in the repository for calculating the kind of CRC32 that is included in <a href="http://www.exactaudiocopy.de/">EAC</a> log files.</p>
<ul>
<li><strong>ar_crc</strong>: Calculate AccurateRip checksums the naive way (for one offset) and for frame 450.</li>
<li><strong>ckcdda</strong>: Calculate AccurateRip checksums for all offsets (only offset 0 is actually printed).</li>
<li><strong>eac_crc32</strong>: Calculate EAC CRC32 both with and without silent samples.</li>
</ul>
<p>The code is the documentation, but it should be easy enough to follow. The tools read raw CD audio data from stdin. Track lengths must be given in sector size.</p>
<pre>&lt;raw audio output&gt; | ar_crc &lt;offset&gt; &lt;track 1 length&gt; .. &lt;track N length&gt;
&lt;raw audio output&gt; | ckcdda &lt;track 1 length&gt; .. &lt;track N length&gt;
&lt;raw audio output&gt; | eac_crc32</pre>
<p>The raw audio output can for example be produced from FLAC files in the following manner:</p>
<pre>flac --decode --stdout --force-raw-format --endian=little --sign=signed Track*.flac</pre>
<p><a href="https://flattr.com/submit/auto?title=AccurateRip tools&url=http://jonls.dk/2010/10/accuraterip-tools/&language=en_GB&user_id=jonls&category=software&tags=open source, linux, command line, cdda, audio, accuraterip, eac"><img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/10/accuraterip-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Redshift 1.6 released</title>
		<link>http://jonls.dk/2010/10/redshift-1-6-released/</link>
		<comments>http://jonls.dk/2010/10/redshift-1-6-released/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 12:10:02 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Redshift]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[redshift]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=171</guid>
		<description><![CDATA[Finally, a new release of Redshift, and at the same time packages have been built for the newly released Ubuntu Maverick (to be found in the PPA as usual). There is a bunch of bug fixes in this release and &#8230; <a href="http://jonls.dk/2010/10/redshift-1-6-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>Finally, a new release of Redshift, and at the same time packages have been built for the newly released Ubuntu Maverick (to be found in the <a href="https://launchpad.net/~jonls/+archive/redshift-ppa">PPA</a> as usual). There is a bunch of bug fixes in this release and some hastily thrown-together configuration file support. It works, but there is no documentation other than the example at the end of this post. Here is the list of changes:</div>
<ul>
<li><span style="font-size: 13px; line-height: 19px;">Support for optional configuration file (fixes <a href="https://bugs.launchpad.net/redshift/+bug/590722">#590722</a>).</span></li>
<li><span style="font-size: 13px; line-height: 19px;">Add man page for redshift written by Andrew Starr-Bochicchio (fixes <a href="https://bugs.launchpad.net/redshift/+bug/582196">#582196</a>).</span></li>
<li><span style="font-size: 13px; line-height: 19px;">Explain in help output that 6500K is the neutral color temperature </span><span style="font-size: 13px; line-height: 19px;">(fixes <a href="https://bugs.launchpad.net/redshift/+bug/627113">#627113</a>).</span></li>
<li><span style="font-size: 13px; line-height: 19px;">Fix: Handle multiple instances of the GNOME clock applet; contributed by </span><span style="font-size: 13px; line-height: 19px;">Francesco Marella (fixes <a href="https://bugs.launchpad.net/redshift/+bug/610860">#610860</a>).</span></li>
<li><span style="font-size: 13px; line-height: 19px;">Fix: Redshift crashes when VidMode fails (fixes <a href="https://bugs.launchpad.net/redshift/+bug/657451">#657451</a>).</span></li>
<li><span style="font-size: 13px; line-height: 19px;">Fix: Toggle menu item should not be of class gtk.ImageMenuItem </span><span style="font-size: 13px; line-height: 19px;">(fixes <a href="https://bugs.launchpad.net/redshift/+bug/620355">#620355</a>).</span></li>
<li><span style="font-size: 13px; line-height: 19px;">New translations and translation updates: Lithuanian (Aurimas Fišeras); </span><span style="font-size: 13px; line-height: 19px;">Brazilian Portuguese (Matteus Sthefano Leite da Silva); </span><span style="font-size: 13px; line-height: 19px;">Finnish (Jani Välimaa); Italian (Simone Sandri); French (Emilien Klein); </span><span style="font-size: 13px; line-height: 19px;">Russian (Anton Chernyshov).</span></li>
</ul>
<h3>Looking forward to 1.6.1</h3>
<p>I hope to release Redshift 1.6.1 before the end of the month. It will include some small bug fixes, updated documentation and updated translations, but for this to happen I will need your help:</p>
<ul>
<li>Please help <a href="https://translations.launchpad.net/redshift">get the translations </a>finished for 1.6.1 if you are fluent in one of the languages that Redshift has been translated to. The text strings will not change before 1.6.1.</li>
<li>Are you familiar with writing man pages? Please help document the configuration file syntax (<a href="https://bugs.launchpad.net/redshift/+bug/662632">#662632</a>).</li>
</ul>
<h3>Configuration file</h3>
<p>Redshift will look for a configuration file in &#8220;~/.config/redshift.conf&#8221; (or in XDG_CONFIG_HOME if that has been set). A different configuration file can be loaded with the command line option &#8220;-c&#8221;. Here is an example:</p>
<pre>; Global settings
[redshift]
temp-day=5700
temp-night=3500
transition=1
gamma=0.8:0.7:0.8
location-provider=manual
adjustment-method=vidmode

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=55.0
lon=12.0

; In this example screen 1 is adjusted by vidmode. Note
; that the numbering starts from 0, so this is actually
; the second screen.
[vidmode]
screen=1</pre>
<p><a href="https://flattr.com/submit/auto?title=Redshift 1.6 released&url=http://jonls.dk/redshift/&category=text"><img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/10/redshift-1-6-released/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Windows gamma adjustments</title>
		<link>http://jonls.dk/2010/09/windows-gamma-adjustments/</link>
		<comments>http://jonls.dk/2010/09/windows-gamma-adjustments/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 07:00:22 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Redshift]]></category>
		<category><![CDATA[f.lux]]></category>
		<category><![CDATA[gamma]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=157</guid>
		<description><![CDATA[When porting Redshift to Windows I ran into the trouble when setting a color temperature lower than about 4500K. The problem is that Windows sets limitations on what kinds of gamma adjustments can be made, probably as a means of protecting the user against evil programs that invert the colors, blank the display or play some other annoying trick with the gamma ramps. This kind of limitation is perhaps understandable, but the problem is the complete lack of documentation. A program that tries to set a gamma ramp that is not allowed will simply fail with a generic error leaving the programmer wondering what could have gone wrong. <a href="http://jonls.dk/2010/09/windows-gamma-adjustments/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When porting <a href="http://jonls.dk/redshift/">Redshift</a> to Windows I ran into trouble when setting a color temperature lower than about 4500K. The problem is that Windows sets limitations on what kinds of gamma adjustments can be made, probably as a means of protecting the user against evil programs that invert the colors, blank the display, or play some other annoying trick with the gamma ramps. This kind of limitation is perhaps understandable, but the problem is the complete lack of documentation of this feature (<a href="http://msdn.microsoft.com/en-us/library/dd372194(VS.85).aspx">SetDeviceGammaRamp</a> on MSDN). A program that tries to set a gamma ramp that is not allowed will simply fail with a generic error leaving the programmer wondering what went wrong.</p>
<p>There are workarounds, but you will not find them anywhere unless you have the patience to work your way through assembly listings of Windows DLLs. So here they are, for your convenience; these two tricks will work at least on a Windows 7 machine:</p>
<ul>
<li>Go to the registry database and create the key &#8220;GdiIcmGammaRange&#8221; (that&#8217;s a capital I in Icm as in Image Color Management) under &#8220;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM&#8221;. The type must be DWORD. The value determines the amount of adjustment that can be made, where 0 means no adjustments possible at all, and 256 means any adjustment is allowed. You&#8217;ll find a REG-file below that sets it to 256.</li>
<li>Run your program from the <a href="http://msdn.microsoft.com/en-us/library/ms684190(VS.85).aspx">Local System</a> account.</li>
</ul>
<div id="attachment_240" class="wp-caption aligncenter" style="width: 310px"><a href="http://jonls.dk/wp-content/uploads/regedit_gamma.png"><img src="http://jonls.dk/wp-content/uploads/regedit_gamma-300x165.png" alt="" title="Extend range of possible gamma adjustment in Windows" width="300" height="165" class="size-medium wp-image-240" /></a><p class="wp-caption-text">The registry key should be set as shown in this screen shot.</p></div>
<p>So if you want to run the experimental build of Redshift on Windows, you need to use one of the above methods if you want to use the same color temperatures as are available on the linux version.</p>
<p><strong>Update:</strong> Here&#8217;s a REG-file that will set the appropriate key in the registry: <a href='http://jonls.dk/wp-content/uploads/RemoveGammaLimitation.reg_.txt'>RemoveGammaLimitation.reg</a>. Save it with a &#8220;.reg&#8221; extension and double click to apply.</p>
<p><a href="https://flattr.com/submit/auto?title=Windows gamma adjustments&url=http://jonls.dk/2010/09/windows-gamma-adjustments/&language=en_GB&user_id=jonls&category=text&tags=gamma, hacking, windows"><img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/09/windows-gamma-adjustments/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Redshift 1.5 released</title>
		<link>http://jonls.dk/2010/08/redshift-1-5-released/</link>
		<comments>http://jonls.dk/2010/08/redshift-1-5-released/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 20:11:31 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Redshift]]></category>
		<category><![CDATA[redshift]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=152</guid>
		<description><![CDATA[I had wanted to release redshift 1.5 last month but for various reasons I never got around to it. Today I received a very generous donation which reminded me that I really needed to get this release out.  The source is available &#8230; <a href="http://jonls.dk/2010/08/redshift-1-5-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had wanted to release <a href="http://jonls.dk/redshift/">redshift</a> 1.5 last month but for various reasons I never got around to it. Today I received a very generous donation which reminded me that I really needed to get this release out.  The <a href="https://launchpad.net/redshift/+download">source</a> is available from the <a href="https://launchpad.net/redshift">launchpad project page</a> as usual. Packages for Ubuntu Lucid are <a href="https://launchpad.net/~jonls/+archive/redshift-ppa">available in the PPA</a>. The contributors for this release are: Francesco Marella, Gabriel de Perthuis, aleth and the translators.</p>
<ul>
<li>Application launcher and autostart feature contributed by Francesco Marella (fixes #590550, #612710).</li>
<li>Improve GNOME location provider (patch by Gabriel de Perthuis) (fixes #598277).</li>
<li>New ubuntu-mono-dark icons that fit the color guidelines better. Contributed by aleth (semi-fixes #596536).</li>
<li>Improve error message when first adjustment method fails (fixes #596537).</li>
<li>Translation updates: Basque (Ibai Oihanguren); Chinese (Jonathan Lumb);
<div id="_mcePaste">French (Hangman, XioNoX); German (Jan-Christoph Borchardt); Hebrew</div>
<div id="_mcePaste">(dotancohen); Spanish (Fernando Ossandon)</div>
</li>
</ul>
<p>Thank you contributors and donators! (btw, the donation will be spent on hosting for this website).</p>
<p><a href="https://flattr.com/submit/auto?title=Redshift 1.5 released&url=http://jonls.dk/redshift/&category=text"><img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/08/redshift-1-5-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Redshift 1.4 released</title>
		<link>http://jonls.dk/2010/06/redshift-1-4-released/</link>
		<comments>http://jonls.dk/2010/06/redshift-1-4-released/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 22:50:24 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Redshift]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[gpl]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ppa]]></category>
		<category><![CDATA[redshift]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=113</guid>
		<description><![CDATA[I&#8217;ve released redshift 1.4 today. The source is available from the launchpad project page as usual. Packages for Ubuntu Lucid are available in the PPA. There&#8217;s lots of exiting new stuff in this release thanks to several contributors: Francesco Marella, &#8230; <a href="http://jonls.dk/2010/06/redshift-1-4-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve released <a href="http://jonls.dk/redshift/">redshift</a> 1.4 today. The <a href="https://launchpad.net/redshift/+download">source</a> is available from the <a href="https://launchpad.net/redshift">launchpad project page</a> as usual. Packages for Ubuntu Lucid are <a href="https://launchpad.net/~jonls/+archive/redshift-ppa">available in the PPA</a>. There&#8217;s lots of exiting new stuff in this release thanks to several contributors: Francesco Marella, Dan Helfman and all the translators.</p>
<ul>
<li>Command line options for color adjustment methods changed. Procedure for setting specific screen (-s) or CRTC (-c) changed. See <code>redshift -h</code> for more information.</li>
<li>Automatically obtain the location from the GNOME Clock applet if possible.</li>
<li>Add application indicator GUI (by Francesco Marella) (fixes #588086).</li>
<li>Add reset option (-x) that removes any color adjustment applied. Based on patch by Dan Helfman (fixes #590777).</li>
<li><code>configure</code> options for GUI changed; see <code>configure --help</code> for more information.</li>
<li>New translations: German (Jan-Christoph Borchardt), Italian (Andrea Amoroso), Czech (clever_fox), Spanish (Fernando Ossandon), Finnish (Ilari Oras).</li>
</ul>
<p>UPDATE: 1.4.1 released. It includes mono icons for Ubuntu (by Joern Konopka); the status icon toggles to show whether Redshift is on or off; and it has updated translations: Spanish (Fernando Ossandon), Russian (Чистый).</p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/06/redshift-1-4-released/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Settlers 1 remake</title>
		<link>http://jonls.dk/2010/06/settlers-1-remake/</link>
		<comments>http://jonls.dk/2010/06/settlers-1-remake/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 16:42:54 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[remake]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<category><![CDATA[serf city]]></category>
		<category><![CDATA[settlers]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=97</guid>
		<description><![CDATA[Update: More info here. Here&#8217;s a quick preview of something I&#8217;ve been working on. As you can see, it uses the graphics from the original game. It is beginning to approach a state where it&#8217;s actually playable. Here&#8217;s some more &#8230; <a href="http://jonls.dk/2010/06/settlers-1-remake/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><b>Update:</b> <a href="http://jonls.dk/freeserf/">More info here</a>.</p>
<p>Here&#8217;s a quick preview of something I&#8217;ve been working on.</p>
<p><a href="http://jonls.dk/wp-content/uploads/sett-pre_20100605-1.jpg"><img class="aligncenter size-full wp-image-102" title="Settlers 1 remake (preview 2010-06-05, 1)" src="http://jonls.dk/wp-content/uploads/sett-pre_20100605-1.jpg" alt="" width="400" height="170" /></a></p>
<p>As you can see, it uses the graphics from the original game. It is beginning to approach a state where it&#8217;s actually playable. Here&#8217;s some more screens for your viewing pleasure:</p>

<a href='http://jonls.dk/2010/06/settlers-1-remake/sett-pre_20100605-2/' title='Settlers 1 remake (preview 2010-06-05, 2)'><img width="150" height="150" src="http://jonls.dk/wp-content/uploads/sett-pre_20100605-2-150x150.jpg" class="attachment-thumbnail" alt="Settlers 1 remake (preview 2010-06-05, 2)" title="Settlers 1 remake (preview 2010-06-05, 2)" /></a>
<a href='http://jonls.dk/2010/06/settlers-1-remake/sett-pre_20100605-3/' title='Settlers 1 remake (preview 2010-06-05, 3)'><img width="150" height="150" src="http://jonls.dk/wp-content/uploads/sett-pre_20100605-3-150x150.jpg" class="attachment-thumbnail" alt="Settlers 1 remake (preview 2010-06-05, 3)" title="Settlers 1 remake (preview 2010-06-05, 3)" /></a>

<p><a href="https://flattr.com/submit/auto?title=Settlers 1 remake&url=http://jonls.dk/2010/06/settlers-1-remake/&language=en_GB&user_id=jonls&category=text&tags=game, remake, reverse engineering, settlers, serf city"><img src="https://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/06/settlers-1-remake/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Showing huge images with Google Maps</title>
		<link>http://jonls.dk/2010/04/showing-huge-images-with-google-maps/</link>
		<comments>http://jonls.dk/2010/04/showing-huge-images-with-google-maps/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 09:40:26 +0000</pubDate>
		<dc:creator>Jon Lund Steffensen</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cairo]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://jonls.dk/?p=80</guid>
		<description><![CDATA[The Google Maps API can be used for other things than maps. The tiles were created with this python script: It will convert a PNG image to PNG tiles. The script depends on pycairo to do the cutting and scaling &#8230; <a href="http://jonls.dk/2010/04/showing-huge-images-with-google-maps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Google Maps API can be used for <a title="Google Maps image example" href="http://jonls.dk/gmaps-image/">other things than maps</a>.</p>
<p style="text-align: center;"><a href="http://jonls.dk/gmaps-image/"><img class="aligncenter size-full wp-image-83" title="Google Maps image example" src="http://jonls.dk/wp-content/uploads/gmaps-image.png" alt="" width="408" height="258" /></a></p>
<p>The tiles were created with this python script:</p>
<div id="gist-618639" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="c">#!/usr/bin/env python</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="kn">import</span> <span class="nn">sys</span><span class="o">,</span> <span class="nn">math</span></div><div class='line' id='LC4'><span class="kn">import</span> <span class="nn">cairo</span></div><div class='line' id='LC5'><br/></div><div class='line' id='LC6'><span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">master</span> <span class="o">=</span> <span class="n">cairo</span><span class="o">.</span><span class="n">ImageSurface</span><span class="o">.</span><span class="n">create_from_png</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">dest_width</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">2</span> <span class="k">else</span> <span class="mi">256</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">dest_height</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">3</span> <span class="k">else</span> <span class="mi">256</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">min_zoom</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">4</span><span class="p">])</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">4</span> <span class="k">else</span> <span class="mi">0</span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">max_zoom</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">5</span><span class="p">])</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">5</span> <span class="k">else</span> <span class="mi">0</span></div><div class='line' id='LC12'><br/></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">vert_tiles</span> <span class="o">=</span> <span class="p">(</span><span class="n">master</span><span class="o">.</span><span class="n">get_width</span><span class="p">()</span> <span class="o">+</span> <span class="n">dest_width</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">dest_width</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">horiz_tiles</span> <span class="o">=</span> <span class="p">(</span><span class="n">master</span><span class="o">.</span><span class="n">get_height</span><span class="p">()</span> <span class="o">+</span> <span class="n">dest_height</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">dest_height</span></div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">most_tiles</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">vert_tiles</span><span class="p">,</span> <span class="n">horiz_tiles</span><span class="p">)</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">base_zoom</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">ceil</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">most_tiles</span><span class="p">)</span> <span class="o">/</span> <span class="n">math</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="mi">2</span><span class="p">)))</span></div><div class='line' id='LC18'><br/></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="n">max_zoom</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span><span class="p">(</span><span class="s">&#39;Image dimensions: </span><span class="si">%u</span><span class="s">x</span><span class="si">%u</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">master</span><span class="o">.</span><span class="n">get_width</span><span class="p">(),</span> <span class="n">master</span><span class="o">.</span><span class="n">get_height</span><span class="p">()))</span></div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span><span class="p">(</span><span class="s">&#39;Tile dimensions: </span><span class="si">%u</span><span class="s">x</span><span class="si">%u</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">dest_width</span><span class="p">,</span> <span class="n">dest_height</span><span class="p">))</span></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span><span class="p">(</span><span class="s">&#39;Tiles in base zoom: </span><span class="si">%u</span><span class="s">x</span><span class="si">%u</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">vert_tiles</span><span class="p">,</span> <span class="n">horiz_tiles</span><span class="p">))</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span><span class="p">(</span><span class="s">&#39;Base zoom level: </span><span class="si">%u</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">base_zoom</span><span class="p">)</span></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span><span class="p">(</span><span class="s">&#39;Run with min_zoom and max_zoom parameters to produce tiles.&#39;</span><span class="p">)</span></div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="n">z</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">min_zoom</span><span class="p">,</span> <span class="n">max_zoom</span><span class="o">+</span><span class="mi">1</span><span class="p">):</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">scale</span> <span class="o">=</span> <span class="mi">2</span><span class="o">**</span><span class="p">(</span><span class="n">z</span> <span class="o">-</span> <span class="n">base_zoom</span><span class="p">)</span></div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">src_width</span> <span class="o">=</span> <span class="n">dest_width</span> <span class="o">*</span> <span class="mi">2</span><span class="o">**</span><span class="p">(</span><span class="n">base_zoom</span> <span class="o">-</span> <span class="n">z</span><span class="p">)</span></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">src_height</span> <span class="o">=</span> <span class="n">dest_height</span> <span class="o">*</span> <span class="mi">2</span><span class="o">**</span><span class="p">(</span><span class="n">base_zoom</span> <span class="o">-</span> <span class="n">z</span><span class="p">)</span></div><div class='line' id='LC32'><br/></div><div class='line' id='LC33'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">vert_tiles</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">floor</span><span class="p">((</span><span class="n">master</span><span class="o">.</span><span class="n">get_width</span><span class="p">()</span> <span class="o">+</span> <span class="n">src_width</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">src_width</span><span class="p">))</span></div><div class='line' id='LC34'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">horiz_tiles</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">floor</span><span class="p">((</span><span class="n">master</span><span class="o">.</span><span class="n">get_height</span><span class="p">()</span> <span class="o">+</span> <span class="n">src_height</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">src_height</span><span class="p">))</span></div><div class='line' id='LC35'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span><span class="p">(</span><span class="s">&#39;Zoom level </span><span class="si">%u</span><span class="s"> (tiles: </span><span class="si">%u</span><span class="s">x</span><span class="si">%u</span><span class="s">)&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">vert_tiles</span><span class="p">,</span> <span class="n">horiz_tiles</span><span class="p">))</span></div><div class='line' id='LC36'><br/></div><div class='line' id='LC37'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">horiz_tiles</span><span class="p">):</span></div><div class='line' id='LC38'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">vert_tiles</span><span class="p">):</span></div><div class='line' id='LC39'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">tile</span> <span class="o">=</span> <span class="n">cairo</span><span class="o">.</span><span class="n">ImageSurface</span><span class="p">(</span><span class="n">cairo</span><span class="o">.</span><span class="n">FORMAT_ARGB32</span><span class="p">,</span> <span class="n">dest_width</span><span class="p">,</span> <span class="n">dest_height</span><span class="p">)</span></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ctx</span> <span class="o">=</span> <span class="n">cairo</span><span class="o">.</span><span class="n">Context</span><span class="p">(</span><span class="n">tile</span><span class="p">)</span></div><div class='line' id='LC41'><br/></div><div class='line' id='LC42'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">pattern</span> <span class="o">=</span> <span class="n">cairo</span><span class="o">.</span><span class="n">SurfacePattern</span><span class="p">(</span><span class="n">master</span><span class="p">)</span></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">pattern</span><span class="o">.</span><span class="n">set_filter</span><span class="p">(</span><span class="n">cairo</span><span class="o">.</span><span class="n">FILTER_BEST</span><span class="p">)</span></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">pattern</span><span class="o">.</span><span class="n">set_matrix</span><span class="p">(</span><span class="n">cairo</span><span class="o">.</span><span class="n">Matrix</span><span class="p">(</span><span class="n">xx</span><span class="o">=</span><span class="mf">1.0</span><span class="o">/</span><span class="n">scale</span><span class="p">,</span></div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">yy</span><span class="o">=</span><span class="mf">1.0</span><span class="o">/</span><span class="n">scale</span><span class="p">,</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">x0</span><span class="o">=</span><span class="n">x</span><span class="o">*</span><span class="n">dest_width</span><span class="o">/</span><span class="n">scale</span><span class="p">,</span></div><div class='line' id='LC47'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">y0</span><span class="o">=</span><span class="n">y</span><span class="o">*</span><span class="n">dest_height</span><span class="o">/</span><span class="n">scale</span><span class="p">))</span></div><div class='line' id='LC48'><br/></div><div class='line' id='LC49'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ctx</span><span class="o">.</span><span class="n">set_source</span><span class="p">(</span><span class="n">pattern</span><span class="p">)</span></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ctx</span><span class="o">.</span><span class="n">rectangle</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">dest_width</span><span class="p">,</span> <span class="n">dest_height</span><span class="p">)</span></div><div class='line' id='LC51'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">ctx</span><span class="o">.</span><span class="n">fill</span><span class="p">()</span></div><div class='line' id='LC52'><br/></div><div class='line' id='LC53'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span><span class="p">(</span><span class="s">&#39;+ tile-</span><span class="si">%u</span><span class="s">-</span><span class="si">%u</span><span class="s">x</span><span class="si">%u</span><span class="s">.png&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span></div><div class='line' id='LC54'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">tile</span><span class="o">.</span><span class="n">write_to_png</span><span class="p">(</span><span class="s">&#39;tile-</span><span class="si">%u</span><span class="s">-</span><span class="si">%u</span><span class="s">x</span><span class="si">%u</span><span class="s">.png&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/618639/87554644a7f52b44b757672c2610243b5e999b7c/pngmaptiler.py" style="float:right;">view raw</a>
            <a href="https://gist.github.com/618639#file_pngmaptiler.py" style="float:right;margin-right:10px;color:#666">pngmaptiler.py</a>
            <a href="https://gist.github.com/618639">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>It will convert a PNG image to PNG tiles. The script depends on <a href="http://cairographics.org/pycairo/">pycairo</a> to do the cutting and scaling of the images. This example converts master.png to tiles of size 256&#215;256 with 1 being the minimum zoom level and 4 being the maximum zoom:</p>
<pre>$ pngmaptiler.py master.png 256 256 1 4</pre>
]]></content:encoded>
			<wfw:commentRss>http://jonls.dk/2010/04/showing-huge-images-with-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

