<?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>my tech blog &#187; gimp</title>
	<atom:link href="http://billauer.se/blog/category/gimp/feed/" rel="self" type="application/rss+xml" />
	<link>https://billauer.se/blog</link>
	<description>Anything I found worthy to write down.</description>
	<lastBuildDate>Thu, 12 Mar 2026 11:36:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Random notes about Gimp 2.10</title>
		<link>https://billauer.se/blog/2020/12/gimp-2-10-notes/</link>
		<comments>https://billauer.se/blog/2020/12/gimp-2-10-notes/#comments</comments>
		<pubDate>Sun, 13 Dec 2020 03:27:46 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[gimp]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=6188</guid>
		<description><![CDATA[This is just a few notes to self on this tool. Version 2.10 is a big deal: It&#8217;s the first one to use GPU acceleration for scaling and rotation, as well as deforming of different types. No more small previews, no more sluggish response to scaling. No need to scale down images for working, because [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a few notes to self on this tool.</p>
<ul>
<li>Version 2.10 is a big deal: It&#8217;s the first one to use GPU acceleration for scaling and rotation, as well as deforming of different types. No more small previews, no more sluggish response to scaling. No need to scale down images for working, because it was too slow.</li>
<li>The default theme (dark) is a joke. It&#8217;s elegant, but it&#8217;s difficult to see the differences between dark grey and lighter grey, which is the difference between a layer lock being enabled or not. I went for &#8220;system&#8221;, which got me Mint colors and nice icon spacing. Doesn&#8217;t look very elegant, but hey, I now know what I&#8217;m doing.</li>
<li>The default icons are a joke as well. Very sleek, but the colors are gone. Once again, it&#8217;s elegance vs. functionality. There&#8217;s a &#8220;color&#8221; option for the icon. Looks like a children&#8217;s toolbox now, but it&#8217;s much easier to find the correct tool.</li>
</ul>
<h3>Linked layers</h3>
<p>First and foremost: Layer groups is most likely the preferred solution. In particular, I used to link between a layer with a layer mask and its duplicate with the same layer mask applied in order to resize / rotate the layer along its layer mask. This isn&#8217;t necessary anymore: Just put the layer with a layer mask inside a group, and manipulate the group instead of the layer. This is quicker than this duplicate, apply and link method, but there&#8217;s one feature still lacking: The ability to crop the layer to which the mask has been applied, and manipulate a smaller area.</p>
<p>Linked layers doesn&#8217;t seem to work on 2.10.14 &#8212; this seems to be a bug: Say, when linking two layers and scaling / rotating one of them, nothing happens with the other.</p>
<p>Solution / workaround: There are two options I know of:</p>
<ul>
<li>Don&#8217;t use linked layers: Put the relevant layers in a layer group, and do the scaling / rotation on the group. But that doesn&#8217;t work well for manipulating a small layer in order to apply the changes on a larger one.</li>
<li>Link between a layer group (possibly with one layer) and the layers that are affected by it. This really looks like a bug workaround: Linking layers to a layer <strong>group</strong> will make the changes to the layer group apply to all other layers. But only if the manipulations are made to the layer group. Which is more or less fine, because the normal way to work is to manipulate some specific layer, and the others follow. So put that layer in a group of its own, and link the others with the group.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2020/12/gimp-2-10-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIMP Curves: Cleaning up old settings</title>
		<link>https://billauer.se/blog/2010/07/gimp-curves-clear-clean-script/</link>
		<comments>https://billauer.se/blog/2010/07/gimp-curves-clear-clean-script/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 22:32:01 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[gimp]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=648</guid>
		<description><![CDATA[Each and every time you use the Curves function in GIMP 2.6, it saves that setting, and labels it with the time it was used. The same color curve can then be used again, just by recognizing the time in the Presets drop-down menu within the Curves dialog box. This is a great feature, since [...]]]></description>
			<content:encoded><![CDATA[<p>Each and every time you use the Curves function in GIMP 2.6, it saves that setting, and labels it with the time it was used. The same color curve can then be used again, just by recognizing the time in the Presets drop-down menu within the Curves dialog box. This is a great feature, since it&#8217;s common to want to repeat a good curve setting, even if it wasn&#8217;t clear it&#8217;s so good when it was done.</p>
<p>Anyhow, there&#8217;s a little problem: The list gets very large after a while. Presets saved by name will most likely appear last, making them effectively unavailable.</p>
<p>The presets are stored as LISP code in a file called ~/.gimp-2.6/tool-options/gimp-curves-tool.settings (the tilde means &#8220;your home directory&#8221;). This is great news, because editing or clearing this file (possible deleting it) allows you to clean up this list.</p>
<p>But even better, it looks like these LISP expressions can be copied into a script, to repeat a Curves operation. I&#8217;ve discussed GIMP scripts <a href="https://billauer.se/blog/2009/07/gimp-xcf-jpg-jpeg-convert-bash-script/" target="_blank">here</a>, so you may want to give it a try. I haven&#8217;t tried to adopt these curve settings in a script yet, because I haven&#8217;t had the need. If you&#8217;re successful with this, please leave a comment below.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2010/07/gimp-curves-clear-clean-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using GIMP to get rid of cellulitis</title>
		<link>https://billauer.se/blog/2010/06/gimp-skin-imperfections-cellulitis-hard-light/</link>
		<comments>https://billauer.se/blog/2010/06/gimp-skin-imperfections-cellulitis-hard-light/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 22:21:36 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[gimp]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=577</guid>
		<description><![CDATA[This is a short note about how to get rid of cellulitis on natural skin, using GIMP 2.6 (will most likely work on earlier versions as well). The truth is that I don&#8217;t really understand why this works, but it fixed a nasty case of ugly skin texture in a low key photo. The trick [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short note about how to get rid of cellulitis on natural skin, using GIMP 2.6 (will most likely work on earlier versions as well).</p>
<p>The truth is that I don&#8217;t really understand why this works, but it fixed a nasty case of ugly skin texture in a low key photo. The trick was using the hard light layer mode, which is described in detail in the <a href="http://docs.gimp.org/en/gimp-concepts-layer-modes.html" target="_blank">GIMP documentation</a>. Unfortunately, the explanations and equations didn&#8217;t help me much in understanding why it happened as it happened.</p>
<p>So here&#8217;s the procedure, as I did it. If it doesn&#8217;t work for you, don&#8217;t blame me. I have no idea what I actually did.</p>
<p>Original image:</p>
<div id="attachment_578" class="wp-caption alignnone" style="width: 404px"><img class="size-full wp-image-578 " title="Original image" src="https://billauer.se/blog/wp-content/uploads/2010/06/cell-1.jpg" alt="Original image" width="394" height="394" /><p class="wp-caption-text">Original image</p></div>
<p>Duplicate the layer, and blur the upper layer strongly (Gaussinan blur, radius 40 in our case)</p>
<div id="attachment_579" class="wp-caption alignnone" style="width: 404px"><img class="size-full wp-image-579 " title="Stage two: Image blurred" src="https://billauer.se/blog/wp-content/uploads/2010/06/cell-2.jpg" alt="Stage two: Image blurred" width="394" height="394" /><p class="wp-caption-text">Stage two: Image blurred</p></div>
<p>Set upper layer&#8217;s mode as &#8220;Hard light&#8221;</p>
<div id="attachment_580" class="wp-caption alignnone" style="width: 404px"><img class="size-full wp-image-580 " title="Stage 3: Hard light applied" src="https://billauer.se/blog/wp-content/uploads/2010/06/cell-3.jpg" alt="Stage 3: Hard light applied" width="394" height="394" /><p class="wp-caption-text">Stage 3: Hard light applied</p></div>
<p>Merge down the upper layer, so they become one layer, and reduce the saturation:</p>
<div id="attachment_581" class="wp-caption alignnone" style="width: 404px"><img class="size-full wp-image-581 " title="Final result" src="https://billauer.se/blog/wp-content/uploads/2010/06/cell-4.jpg" alt="Final result" width="394" height="394" /><p class="wp-caption-text">Final result</p></div>
<p>This may not look like a significant change, but when zooming out, it is.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2010/06/gimp-skin-imperfections-cellulitis-hard-light/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color Range Mapping on GIMP 2.6: Getting it back.</title>
		<link>https://billauer.se/blog/2010/06/gimp-map-color-range-mapping-64-bit/</link>
		<comments>https://billauer.se/blog/2010/06/gimp-map-color-range-mapping-64-bit/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 09:30:07 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[gimp]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=571</guid>
		<description><![CDATA[One of the nice things about upgrading software, is not only that there are a lot of new, confusing and useless features, but also that things that used to work in the past don&#8217;t anymore. At best, features which one used a lot have completely disappeared. Upgrading to Fedora 12, with its GIMP 2.6, was [...]]]></description>
			<content:encoded><![CDATA[<p>One of the nice things about upgrading software, is not only that there are a lot of new, confusing and useless features, but also that things that used to work in the past don&#8217;t anymore. At best, features which one used a lot have completely disappeared. Upgrading to Fedora 12, with its GIMP 2.6, was no exception.</p>
<p>It looks like the GIMP developers found the Color Range Mapping plugin useless, as is apparent from <a href="https://bugzilla.gnome.org/show_bug.cgi?id=436145" target="_blank">their correspondence</a>.  As Sven Neumann says over there, &#8220;Let&#8217;s remove those plug-ins then if the code sucks that much. Are they in anyway useful at all?&#8221;</p>
<p>Let me answer you, Sven. Yes, it&#8217;s very very useful. I don&#8217;t know if Photoshop has a similar feature, but color range mapping is extremely useful in photomontage. That&#8217;s when you need one exact color at one place, and another exact color at another.</p>
<p>When the absence of the relevant plugin was reported in a <a href="https://bugzilla.gnome.org/show_bug.cgi?id=558454" target="_blank">bug report</a>, it was said that &#8220;Looking at it again, the plug-in really was so badly broken, I would prefer if we would not have to add it back.&#8221; Broken or not, I love this plugin.</p>
<p>To fix my own problem, I followed <a href="http://wtanaka.com/node/7904" target="_blank">this post</a> and fetched myself an x86-64 rpm of an old version of GIMP. Matching architecture is important, because the plugins are precompiled binaries.</p>
<p>I downloaded just the first RPM I could find of GIMP, which was of version 2.4 and compiled for x86_64, and then extracted the files in an empty directory with</p>
<pre><code>rpm2cpio gimp-2.4.6-1.fc7.x86_64.rpm | cpio -idvm
</code></pre>
<p>And then, as root:</p>
<pre>cp usr/lib64/gimp/2.0/plug-ins/mapcolor /usr/lib64/gimp/2.0/plug-ins/</pre>
<p>and that&#8217;s all! Restarting GIMP I found my beloved plugin there. Happy, happy, joy, joy!</p>
<p><em>Update 14.7.21: In Gimp 2.10, there&#8217;s a separate directory for each plug-in, but all in all, it&#8217;s the same:</em></p>
<pre><em># cd /usr/lib/gimp/2.0/plug-ins/</em>
<em># mkdir mapcolor</em>
<em># cp /path/to/old/gimp/2.0/plug-ins/mapcolor mapcolor/</em>
</pre>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2010/06/gimp-map-color-range-mapping-64-bit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Command-line (bash/GIMP) mass conversion and processing</title>
		<link>https://billauer.se/blog/2009/07/gimp-xcf-jpg-jpeg-convert-bash-script/</link>
		<comments>https://billauer.se/blog/2009/07/gimp-xcf-jpg-jpeg-convert-bash-script/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 12:52:20 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[gimp]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[jpg]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[script-fu]]></category>
		<category><![CDATA[xcf]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=346</guid>
		<description><![CDATA[The purpose I use GIMP a lot. I store the images in the native file format, XCF. Now I&#8217;m stuck with a lot of files I can&#8217;t see outside GIMP, but I don&#8217;t want to save those files as anything else, because I&#8217;ll lose all the layer data. Solution: Batch conversion to JPEG as a [...]]]></description>
			<content:encoded><![CDATA[<h3>The purpose</h3>
<p>I use GIMP a lot. I store the images in the native file format, XCF. Now I&#8217;m stuck with a lot of files I can&#8217;t see outside GIMP, but I don&#8217;t want to save those files as anything else, because I&#8217;ll lose all the layer data. Solution: Batch conversion to JPEG as a simple bash script to run from the command line.</p>
<p>The idea is to make a JPEG copy of the image as it&#8217;s seen when it&#8217;s opened with GIMP. For that reason, I&#8217;ve chosen to flatten the image by visible layers only, and to crop it to image size.</p>
<p>Also, I&#8217;ll show an example of how to massively fix images with a GIMP script.</p>
<p><em><span style="text-decoration: underline;">2022 update</span>: This post is really old. Nowadays ImageMagick supports XCF, so it&#8217;s possible to just go</em></p>
<pre>$ convert this.xcf this.jpg</pre>
<p><em>But this post can still be of use for more sophisticated tasks with GIMP.</em></p>
<h3>The script</h3>
<p>It looks like LISP and it looks like bash. In fact, they&#8217;re mixed.</p>
<pre>#!/bin/bash
{
cat &lt;&lt;EOF
(define (convert-xcf-to-jpeg filename outfile)
  (let* (
	 (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
	 (drawable (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE)))
	 )
    (file-jpeg-save RUN-NONINTERACTIVE image drawable outfile outfile .9 0 0 0 " " 0 1 0 1)
    (gimp-image-delete image) ; ... or the memory will explode
    )
  )

(gimp-message-set-handler 1) ; Messages to standard output
EOF

for i in *.xcf; do
  echo "(gimp-message \"$i\")"
  echo "(convert-xcf-to-jpeg \"$i\" \"${i%%.xcf}.jpg\")"
done

echo "(gimp-quit 0)"
} | gimp -i -b -</pre>
<p>To try it out, simply execute the script from a directory containing several .xcf files. Be sure not have any .jpg files you care about in the same directory, because the outputs are with the same file names, just with the .jpg extension (old files are overwritten with no warning).</p>
<p>You will get kind-of-warning messages while the script is iterating, indicating which file is being processed. This is normal.</p>
<p>The concept of this script is simple. An ad-hoc LISP script is generated in the Bash block, which is enclosed by curly brackets. First we define the function, which converts one file. The bash script then creates calls to this function, by means of the (Bash) for-loop. All this is then fed into GIMP through standard input (piping).</p>
<h3>Some LISP notes</h3>
<p>I&#8217;m not really into LISP. So I ran into some trouble. These are my notes, so I won&#8217;t go through it again:</p>
<p>First, there&#8217;s the Script-Fu console, which was, well, sort-of helpful. The internal functions&#8217; API can be found there as well.</p>
<p>As a LISP novice, I didn&#8217;t know the difference between &#8220;let&#8221; and &#8220;let*&#8221;. It turns out, that let* allows the use of previous assignments in the following ones, so this is what you get in the Script-Fu console:</p>
<pre>&gt; (let ( (x 2) (y x)) y)
Error: eval: unbound variable: x 

&gt; (let* ( (x 2) (y x)) y)
2</pre>
<p>It&#8217;s also worth to note, that the GIMP interpreter does <strong>not</strong> remember functions across different -b command-line arguments:</p>
<pre># First statement succeeds, second fails.
gimp -i -b '(define (myfun x y) (- x y))' -b '(myfun 2 3)'

# This works, because it's two statements in one execution (yuck!)
gimp -i -b '(define (myfun x y) (- x y)) (myfun 2 3)'</pre>
<h3>Mass processing of frames</h3>
<p>As the title implies, I needed this to make adjustments on a video clip. It&#8217;s true that many video editors (Cinelerra included) have filters for that, but running a sequence of GIMP commands is probably stronger than any possible video editor.</p>
<p>So here&#8217;s a little script which runs some operations on a list of frames. This was useful, mainly because I wanted to run curves on a clip (and Cinelerra doesn&#8217;t have that operation. I wonder which video editor has).</p>
<pre>#!/bin/bash
{
cat &lt;&lt;EOF

(define (do-retouch filename outfile)
 (let* (
 (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
 (drawable (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE)))
 )
 (gimp-colorize drawable 10 50 0)
 (gimp-curves-spline drawable HISTOGRAM-VALUE 6 #(0 0 147 44 255 122 ) )
 (gimp-hue-saturation drawable ALL-HUES 0 0 20)
 (plug-in-gauss RUN-NONINTERACTIVE image drawable 10 10 1)
 (file-png-save2 RUN-NONINTERACTIVE image drawable outfile outfile 0 9 0 0 0 0 0 0 1 )
 (gimp-image-delete image) ; ... or the memory will explode
 )
 )

(gimp-message-set-handler 1) ; Messages to standard output
EOF

for i in frame*.png; do
 echo "(gimp-message \"$i\")"
 echo "(do-retouch \"$i\" \"fixed/x_${i%%.png}.png\")"
done

echo "(gimp-quit 0)"
} | gimp -i -b</pre>
<p>The script-Fu console was helpful in finding the function&#8217;s names, which are pretty obvious. I&#8217;ll only mention that running gimp-image-merge-visible-layers in this case is probably not necessary, but I suppose GIMP won&#8217;t waste too much time on merging a layer with itself.</p>
<p>As for the curves operation (gimp-curves-spline), I first tried to use curves traces which are saved by GIMP as they are being used in the GUI, but that turned out to be pretty complicated. So I went for the simple approach: Open the GUI, find the X-Y points on the graph, and copy them manually. The &#8220;6&#8243; says that there are 6 numbers ahead (3 X-Y pairs), and then we have X0, Y0, X1, Y1, etc. The values go from 0 to 255. So it&#8217;s pretty trivial, and does exactly the same as the GUI.</p>
<h3>Importing the frames to Cinelerra</h3>
<p>Not that it&#8217;s directly relevant, but to import a bunch of frames into Cinelerra, use the <a href="http://sites.google.com/site/akhilman/mkframelist?attredirects=0" target="_blank">mkframelist</a> command line utility and load it like any file. For example,</p>
<pre>$ ls *.png | mkframelist -r 30 &gt; framelist</pre>
<p>For 30 fps, and then load &#8220;framelist&#8221; to Cinelerra. Note that the paths in the list are absolute, so you can&#8217;t just move around the files.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2009/07/gimp-xcf-jpg-jpeg-convert-bash-script/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
