<?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>corrinado_swam &#187; gimp</title>
	<atom:link href="http://emeryclark.net/tag/gimp/feed/" rel="self" type="application/rss+xml" />
	<link>http://emeryclark.net</link>
	<description>Like hell on fire With jelly arms and beaten bones He rode the crests, he broke the waves Trying to get a breath of air for all that he had left to save</description>
	<lastBuildDate>Fri, 21 May 2010 04:47:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scripting Gimp (batch mode)</title>
		<link>http://emeryclark.net/2010/02/scripting-gimp/</link>
		<comments>http://emeryclark.net/2010/02/scripting-gimp/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 06:14:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://emeryclark.net/?p=20</guid>
		<description><![CDATA[Batch scripting with GIMP 2.6]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gimp.org/">The Gimp</a> has a wonderful feature that allows you to run it non-interactively (no User Interface) from the &#8216;command line&#8217;. This allows you to write scripts that can be used in the shell!</p>
<p>I have lots of film negatives that have been scanned to the computer and all were saved as .BMP files. I wrote a simple script to open each file, adjust the levels, and save as a .JPG.</p>
<blockquote><p>; ec-levels-stretch</p>
<p>(define (ec pattern)<br />
(let* ((filelist (cadr (file-glob pattern 1))))<br />
(while (not (null? filelist))<br />
(let*<br />
(<br />
(filename (car filelist))<br />
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))<br />
(new_filename (string-append filename &#8220;.jpg&#8221;))<br />
(drawable (car (gimp-image-get-active-layer image)))<br />
)<br />
; (gimp-levels-stretch drawable)<br />
(file-jpeg-save 1 image drawable new_filename &#8220;&#8221; 0.85 0 1 0 &#8220;&#8221; 0 1 0 1)<br />
(gimp-image-delete image)<br />
)<br />
(set! filelist (cdr filelist))<br />
)<br />
)<br />
)</p>
<p>(script-fu-register &#8220;ec&#8221;<br />
&#8220;ec&#8221;<br />
&#8220;Batch Auto Levels&#8221;<br />
&#8220;Emery clark&#8221;<br />
&#8220;Emery Clark&#8221;<br />
&#8220;2010&#8243;<br />
&#8220;RGB* GRAY*&#8221;</p>
<p>)<br />
(script-fu-menu-register &#8220;ec&#8221;<br />
&#8220;<img alt="" />/Filters&#8221;)</p>
<p>; End script</p></blockquote>
<p>Put the script in &#8216;/home/your_username/.gimp-2.6/scripts&#8217; You can run this from the command line by &#8216;cd /dir/with/images/&#8217; then:</p>
<blockquote><p>gimp -i -b &#8216;(ec &#8221; *.png &#8221; )&#8217; -b &#8216;(gimp-quit 0)&#8217;</p></blockquote>
<p>Read more about batch mode http://www.gimp.org/tutorials/Basic_Batch/. Note: I have tried a modified version of this script and have yet to get it working on the Windows XP command line, please let me know if you can do it. I had to resort to a linux machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://emeryclark.net/2010/02/scripting-gimp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
