<?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>Barefoot Liam &#187; gimp</title>
	<atom:link href="http://www.barefootliam.org/tag/gimp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.barefootliam.org</link>
	<description>Don't hurt your feet on the pointy brackets!</description>
	<lastBuildDate>Mon, 01 Feb 2010 08:03:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Scanning: How to Fix Colour Registration Errors</title>
		<link>http://www.barefootliam.org/oldbooks/20090506-correcting</link>
		<comments>http://www.barefootliam.org/oldbooks/20090506-correcting#comments</comments>
		<pubDate>Thu, 07 May 2009 02:18:39 +0000</pubDate>
		<dc:creator>barefootliam</dc:creator>
				<category><![CDATA[Working with old books]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[old books]]></category>
		<category><![CDATA[scanning]]></category>

		<guid isPermaLink="false">http://www.barefootliam.org/?p=16</guid>
		<description><![CDATA[OK, So you scanned a colour image, and you&#8217;ve got lots of little dots: There are three things I&#8217;ll need to do to make this image useful: smooth out all those dots, scale down the image, and get rid of that yellow fringe. We must actually do them in the opposite order: first the fringe, [...]]]></description>
			<content:encoded><![CDATA[<p>OK, So you scanned a colour image, and you&#8217;ve got lots of little dots:</p>
<div id="attachment_17" class="wp-caption alignright" style="width: 326px"><img class="size-full wp-image-17" src="http://www.barefootliam.org/wp-content/uploads/2009/05/halftoned-1.jpg" alt="colour image as scanned (detail)" width="316" height="274" /><p class="wp-caption-text">colour image as scanned (detail)</p></div>
<p>There are three things I&#8217;ll need to do to make this image useful: smooth out all those dots, scale down the image, and get rid of that yellow fringe.</p>
<p>We must actually do them in the opposite order: first the fringe, then smooth the dots, and then finally scale down.   That&#8217;s because you must always work at the highest resolution so you don&#8217;t lose detail, and because the smoothing will make it harder to fix the fringe.</p>
<p>The yellow fringe is only on one side of this brave warrior&#8217;s head.  He stands there oblivious to the fact he has been badly printed!</p>
<p>To understand what&#8217;s going on, we need to remember how colour printing like this works.  Four separate images were printed on top of each other: a black one (called K), a red one (called M, for Magenta), a Yellow one (Y) and a blue one (called C, for Cyan).  Four images, each printed with a single colour.  The names of these four images, shuffled around, give us CMYK, the name for four-colour images.  The inks have interacted with each other a little, but we will pretend they don&#8217;t, and use GIMP&#8217;s Colours/Components/Decompose menu item, choose CMYK, and end up with a new image with four black layers, one for each of the four colours.</p>
<p>That was a lot of words to describe something simple, but it&#8217;s easier to remember how to do this if you understand what&#8217;s going on.</p>
<p>Now we have our four black layers, we can move the yellow layer down a little.  You can do this using the sample image in this blog posting if you want to try it.  Go to GIMP&#8217;s layers dialogue (you can go to Windows/Dockable Dialogues/Layers if it is not showing).  Hold down shift and click on the eye to the left of the <strong>yellow-k</strong> layer, and then click on the name of the layer next to it, the <strong>yellow-k</strong>, so it&#8217;s selected.  Choose the Move Tool from the toolbox (or press the lower-case <strong>m</strong> key) and then, to move the yellow layer down 10 pixels, press the down-arrow key ten times.</p>
<p>You could try Colours/Components/Recompose now, but it wouldn&#8217;t work, so wait just a moment. First, we must right-click on that <strong>yellow-k</strong> layer in the layers dialogue, and when the menu pops up, choose Layer to Image Size.  This will add some transprent pixels to the top of the yellow layer and chop off the bottom, so that when we recompose, it will be lower.  Otherwise, GIMP shifts the layers back when it does the recompose.  OK, now you can do Colours/Components/Recompose.</p>
<p>The resultimg image is much better.  If you also move the magenta layer a little, you can get to something like this:</p>
<div id="attachment_18" class="wp-caption alignright" style="width: 326px"><img class="size-full wp-image-18" src="http://www.barefootliam.org/wp-content/uploads/2009/05/halftoned-2.jpg" alt="After adjusting the separated CMYK layers and recomposing" width="316" height="274" /><p class="wp-caption-text">After adjusting the separated CMYK layers and recomposing</p></div>
<p>It&#8217;s still not perfect, but because the images are overprinted, moving the yellow layer won&#8217;t really make bits of yellow suddenly appear from underneath red: there will just be a bit of a smudge where the inks blended.</p>
<p>You might also wonder if the individual mis-aligned images might be rotated slightly.  if you wondered this you would be right, but we cant fix that here. If you try, you will generate lots of unwanted patterns because the little dots will make interference patterns and moiré effects. So move them only horizontally and vertically for now.  Later you get a chance to fix rotation, but it is much less effective.</p>
<p>The next steps are easy, and are just like normal scanning: use Filters/Gaussian Blur to get rid of the individual dots.  There&#8217;s some mathematics behind this, but for our purposes all that matters is that the dots vanish in the preview.</p>
<div id="attachment_19" class="wp-caption alignright" style="width: 326px"><img class="size-full wp-image-19" src="http://www.barefootliam.org/wp-content/uploads/2009/05/halftoned-3.jpg" alt="After blurring." width="316" height="274" /><p class="wp-caption-text">After blurring.</p></div>
<p>I used a radius of 9 pixels on this image, which was scanned at 800dpi (or 800ppi for confused pedants). Now I&#8217;ve got a really blurry soldier, perhaps after a few beers, but after I scale him down he will be sharp again.</p>
<p>Note that if you still have colour fringing from <em>rotated</em> mis-printing, you can now try separating into CMYK, rotating the offending layer or layers, using Layer to Image Size on the layer or layers you rotated, and then recomposing.  The blur that we just did will make it safe to rotate, but the separation won&#8217;t be as clean, so depending on the image, it might not work.</p>
<p>You might also want to improve the colours now &#8211; e.g. reducing saturation.</p>
<p>Back to getting smaller. To get a sharp image after a blur radius of 9, you&#8217;ll really need to scale to 33% of the original size or smaller.  I wanted to make a screen background at 1600&#215;1200 pixels in this case, so that was about 30%, although smaller sizes will be sharper.</p>
<div id="attachment_20" class="wp-caption alignright" style="width: 326px"><img class="size-full wp-image-20" src="http://www.barefootliam.org/wp-content/uploads/2009/05/halftoned-4.jpg" alt="After making it smaller, you can see more of it!" width="316" height="274" /><p class="wp-caption-text">After making it smaller, you can see more of it!</p></div>
<p>Here is the result &#8211; since the image is smaller, rather than a small thumbnail I&#8217;ve included more of it, but if you&#8217;re using these images for practice, sadly you won&#8217;t get more of the picture come in from the edges when you scale down <img src='http://www.barefootliam.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  so yours will look a little different.At this size you can&#8217;t really see any remaining colour fringing from misaligned colour separations.</p>
<p>We can still improve ths colour in this image by reducing saturation (it&#8217;s actually best to do that before scaling down usually, of course), but all I&#8217;m going to do right now is Filters/Sharpen, to get a final result like this:</p>
<div id="attachment_21" class="wp-caption alignleft" style="width: 326px"><img class="size-full wp-image-21" src="http://www.barefootliam.org/wp-content/uploads/2009/05/halftoned-5.jpg" alt="After sharpening" width="316" height="274" /><p class="wp-caption-text">After sharpening</p></div>
<p>There&#8217;s still a bit of a magenta fringe above people&#8217;s heads in this example, so moving magenta down may have been worth it.</p>
<p>I used a Sharpness of 65, because a higher value brings back the rosettes a little.  It&#8217;s a tradeoff, but if you see dots again at this stage, you have to use undo right back to the blur, and redo the blur with a larger radius.  Note that Sharpen is likely to give better results than the unsharp mask that many people love. Unsharp mask tends to introduce halo effects around the lines in illustrations like this, but works well for some kinds of photograph. Try them both and see which works best for you.</p>
<p>The final image is (or will soon be) on <a href="http://www.fromoldbooks.org/Marshall-AnIslandStory/">www.fromoldbooks.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barefootliam.org/oldbooks/20090506-correcting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to scan colour images from old books, with Gimp, in 18 easy steps</title>
		<link>http://www.barefootliam.org/oldbooks/20090213-scanning-colour-images</link>
		<comments>http://www.barefootliam.org/oldbooks/20090213-scanning-colour-images#comments</comments>
		<pubDate>Sat, 14 Feb 2009 03:37:50 +0000</pubDate>
		<dc:creator>barefootliam</dc:creator>
				<category><![CDATA[Working with old books]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[old books]]></category>
		<category><![CDATA[scanning]]></category>

		<guid isPermaLink="false">http://www.barefootliam.org/?p=9</guid>
		<description><![CDATA[How to scan colour images from old books, with Gimp, in 18 easy steps. Some people report that a piece of opaque green paper placed behind the page will help reduce show-through; either that or black card seems to help. Look at the image, using a magnifying glass if necessary, and see if it is [...]]]></description>
			<content:encoded><![CDATA[<p>How to scan colour images from old books, with Gimp, in 18 easy steps.</p>
<ol>
<li>Some people report that a piece of <em>opaque green</em> paper placed behind the page will help reduce show-through; either that or black card seems to help.</li>
<li>Look at the image, using a magnifying glass if necessary, and see if it is made of lots of small dots, or is printed with solid areas of dots.  If the book is from before 1850 or so, colours are likely either to have been added by hand, perhaps with a water-colour brush, or in separate print runs of solid colour. If the book is after 1860 or so, there will probably be dots.  You&#8217;ll need this information later.  You might also want to note down the page number.</li>
<li>Make sure the page is flat on the scanner&#8217;s glass!  If necessary, weigh it down a little with another book. If you bend the book back somewhat you can loosen the binding a little, which helps.</li>
<li>If you are using <a href="http://www.gimp.org/">Gimp</a>, you can scan the image by going to the File menu and choosing Create, and under that xsane.  If you are using Photoshop it&#8217;s most likely under the File/Acquire menu.   For an image made of dots (<em>screened</em>) you will need much higher resolution than you might expect, because capturing the exact size and shape of each of those dots determines the amount of detail you will get in your final image.  You can experiment, but I find there is often a noticeable difference between 600 and 1200dpi, and always a noticeable difference between 300 and 600.</li>
<li>When you choose the area to scan (usually by dragging a rectangle), make the area a little larger than the image all round.  There&#8217;s no need to go wild here, as scanning too much will just eat up memory and disk space, but you want enough extra to give you room to rotate the image to make it perfectly level afterwards, and to make sure you don&#8217;t accidentally miss a bit if the preview isn&#8217;t accurate.</li>
<li>Your scanning software (e.g. <em>xsane</em>) will probably have a button to auto-adjust levels, and you should press it.  You want the darkest part of the picture to be black and the lightest part to be white (or nearly white) in the output.  I find that I have to increase the gamma to about 1.2 with xsane, though, to keep the detail.</li>
<li>Once you have scanned the image, you will want to save a copy.  I always include the page number, but since the book is still sitting on the scanner at this point, you can see why I suggested remembering the number!  I tend to use filenames like 0314-Taj-Mahal-raw.png for the original and 0314-Taj-mahal-cleaned.png for the version after I have processed it (which I am about to describe).</li>
<li>Now you have saved the image, you need to make it look like something you want to keep.  The first step is to check the colour range; in Gimp this is colours/levels, and you can use the <em>auto</em> button on that dialogue box to get a good first attempt.  It&#8217;s probably good enough for now, but if the colours go weird, choose <em>reset</em> and instead move the little triangles so they point to the upper and lower ends of the histagram. Now you have an image with colour values spanning the whole range; that&#8217;s important because as we process the image it means we won&#8217;t lose as much detail.</li>
<li>Next we remove the dots.  You can do that with a Gaussian blur.  (if there were no dots, you can skip this step).  Choose Filters/Blur/Gaussian Blur.  When the dialogue appears, make sure the preview is ticked, and move the slider to about 11.  For 1200dpi or higher you may need it to be 17 or higher.  Your goal is to find the <em>smallest</em> number at which you can&#8217;t see any dots in the preview.  Use the scrollbars (and resize the filter window too) until you find a part of the image that&#8217;s fairly light in colour, as the dots are most visible there.  Usually the dots are in clusters, called <em>rosettes</em>, and you need to blue enough that the rosettes are gone too.  Once you find that number, go one or two higher, so, if the rosettes (or at least the dots if you can&#8217;t see rosettes) are gone with a bur radius of 12 in the preview, you&#8217;ll increase the radius to 13 or 14.   Then press OK to blur the image.  It may take a while.<br />
<strong>Note:</strong> If your image has black line art and screened colour, you can experiment using <em>selective gaussian blur</em> to keep the black sharp.</li>
<li>Once the image is blurred, you can rotate it, if needed, so it&#8217;s upright.  This is easiest in <em>gimp</em> using the Rotate tool with the tool options set to reverse/corrective and the preview set to grid; then you can move the grid so it lines up with something horizontal or vertical in the image.   You can change the spacing of the grid lines in tool options to help the grid line up.  Choose <em>Cubic</em> for the rotation algorithm, because you don&#8217;t want to preserve detail here that is just a remnant of the dots.<br />
<strong>Note</strong>: if you rotate <em>before</em> you descreen, you will introduce new artefacts that are difficult to remove. So you do the blur first and then the rotate.</li>
<li>After rotating, flatten the image (rotate introduces transparency, which we don&#8217;t want here).</li>
<li>We are nearly done, don&#8217;t worry.  At this point, I&#8217;d save a new copy of the image with the -cleaned- in its filename, because we&#8217;ve done enough work that we&#8217;d be cross if there was a power failure and we had to start over.</li>
<li>Make sure the image fits in your window (c0ntrol-shift-E in <em>Gimp</em>) and decide how bad the colours look.  Use Colours/Curves and experiment a little.  Or use Colours/levels and use the &#8220;white point&#8221; eye dropper to click on part of the image outside the picture, where there is plain paper.  Your goal now is to get something that looks roughly like the printed original.</li>
<li>Optional step, but very wise: go over the image slowly, at 50% magnification, looking for things like dead insects or hairs or other things you want to fix, and use the clone tool as needed (with a soft brush) to get rid of them.</li>
<li> When you&#8217;re happy, save the file again.  Use PNG, because it&#8217;s lossless.</li>
<li>Now you have a nice clean descreened image, but it&#8217;s blurry and it&#8217;s too big.  No problem: scale it down!  Use image/Scale Image, and go down to, say, 25%, and the image will look much better.  If you want a really sharp image, scale down further, but remember to keep that <em>cleaned</em> PNG file at fill size.  Now, we&#8217;re nearly done!</li>
<li>After you downsize an image you often need to sharpen it, using Filters/Enhance/Sharpen.  Some people prefer unsharp mask, but I find that&#8217;s best for photographs rather than scans of screened prints of photographs. I also prefer to be subtle with sharpening, but again it&#8217;s a matter of preference.</li>
<li>You can save the smaller scaled-down image as JPEG; I find if there are isolated blobs of red that I need to use the 1&#215;1 subsampling to keep the colour right.</li>
</ol>
<p>With practice you can do all this fairly quickly. I find the slowest part is usually fixing any problems like hairs or stuff that falls out of the binding of some older books.  You know, $10,000 bills and ancient Roman golden rings. Or more likely tiny pieces of paper, string or leather.  Wipe the scanner glass between scans with a clean piece of kitchen paper, wiping <em>gently</em> always in the same direction, so that pieces of grit don&#8217;t make scratches.</p>
<p>Oh. If your image did <em>not</em> have tiny dots, but was printed solid, or if there was detail in the black</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barefootliam.org/oldbooks/20090213-scanning-colour-images/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
