{"id":1529,"date":"2013-09-22T16:41:11","date_gmt":"2013-09-22T04:41:11","guid":{"rendered":"http:\/\/www.zoyinc.com\/?p=1529"},"modified":"2020-05-08T19:52:21","modified_gmt":"2020-05-08T07:52:21","slug":"removing-moire-patterns-using-gimp","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=1529","title":{"rendered":"Removing moir\u00e9 patterns using GIMP"},"content":{"rendered":"<p style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection8.jpg\" class=\"thickbox no_icon\" title=\"Moire Problems\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1550\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection8.jpg\" alt=\"Moire Problems\" width=\"320\" height=\"119\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection8.jpg 320w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection8-150x55.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection8-300x111.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a>A moir\u00e9 pattern typically occurs when you scan a printed picture and then view or print out that scan. The above picture is a classic example.<\/p>\n<p style=\"text-align: left;\">This discusses how to use <a  href=\"http:\/\/www.gimp.org\/\">GIMP <\/a>to remove, or mostly remove from your scan, the typical underlying cause of moir\u00e9 patterns. The process we are going to use is generically called &#8220;descreening&#8221; but the exact process we will utilize is Fourier transforms.<\/p>\n<h2 style=\"text-align: left;\">Resources<\/h2>\n<p style=\"text-align: left;\">Descreening with GIMP and Fourier transforms<br \/>\n<a  href=\"http:\/\/www.albumartexchange.com\/forums\/viewtopic.php?f=2&#038;t=1986\"><span style=\"font-size: small;\">http:\/\/www.albumartexchange.com\/forums\/viewtopic.php?f=2&amp;t=1986<\/span><\/a><\/p>\n<p style=\"text-align: left;\">GIMP home page<br \/>\n<a  href=\"http:\/\/www.gimp.org\/\">http:\/\/www.gimp.org\/<\/a><\/p>\n<p style=\"text-align: left;\">GIMP descreen plugin<br \/>\n<a  href=\"http:\/\/registry.gimp.org\/node\/24411\" target=\"_blank\" rel=\"noopener\">http:\/\/registry.gimp.org\/node\/24411<\/a><\/p>\n<h2 style=\"text-align: left;\">What causes moir\u00e9 patterns<\/h2>\n<p style=\"text-align: left;\">Commercial printing presses typically only print solid colors &#8211; they don&#8217;t print shades. So they normally only print CMYK, <strong>C<\/strong>yan <strong>M<\/strong>agenta <strong>Y<\/strong>ellow Black (<strong>K<\/strong>). To get other colors it is necessary to mix colors and use shades. For example to get violet you should use cyan @ 55%, magenta @ 80%, yellow @ 55% and black @ 65%.<\/p>\n<p style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection6.jpg\" class=\"thickbox no_icon\" title=\"CMYK Printing\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1544 alignright\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection6.jpg\" alt=\"CMYK Printing\" width=\"90\" height=\"146\" \/><\/a>If a printer needs print wants to print violet they will print tiny circles of cyan, magenta, yellow and black.\u00a0 The cyan circles will have a surface area of 55, magenta a surface area of 80, yellow a surface area of 55 and finally black with a surface area of 65. This way there will be more magenta in the picture than yellow for example. Basically the lighter the shade the smaller the dots and the more white paper around them.<\/p>\n<p style=\"text-align: left;\">In the scan to the right you can see that the top of the picture is almost full magenta but the size of the magenta dots varies throughout the scan with smaller dots and more white paper in some areas giving the illusion of a lighter color.<\/p>\n<p style=\"text-align: left;\">The problem with this printing technique is that it produces a very grid-like pattern, not a perfect grid but very &#8220;grid like&#8221;. This is best illustrated in a black and white picture:<\/p>\n<p style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection7.jpg\" class=\"thickbox no_icon\" title=\"Grid like\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1545\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection7.jpg\" alt=\"Grid like\" width=\"323\" height=\"108\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection7.jpg 323w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection7-150x50.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection7-300x100.jpg 300w\" sizes=\"auto, (max-width: 323px) 100vw, 323px\" \/><\/a>Computer scanner does a precise grid scan of an image combined with the printing process&#8217;s grid like technique , which produces moire effects. As I say a lot of printing works like this but not all &#8211; laser printers don&#8217;t and neither do true photo graphic (chemical) prints.<\/p>\n<p>&nbsp;<\/p>\n<h2>What can be achieved<\/h2>\n<p>In order to illustrate what can be achieved I scanned a print of some lemons and mandarins. I then made a second copy of the first image, but this time ran a &#8220;descreen&#8221; through it. Finally I then created a third image file twice as wide as the orginal. In this third image I put the original scan on the left and the descreened version on the right &#8211; so side-by-side comparison, no tricks.<\/p>\n<p>I then opened up this third image in Internet Explorer and changed the zoom and below is what I got:<\/p>\n<h2><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection11.jpg\" class=\"thickbox no_icon\" title=\"Fourier Fix Examples\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1553\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection11.jpg\" alt=\"Fourier Fix Examples\" width=\"658\" height=\"499\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection11.jpg 658w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection11-150x113.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection11-300x227.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection11-395x300.jpg 395w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/a><\/h2>\n<p>&nbsp;<\/p>\n<h2>Gimp descreen setup<\/h2>\n<p>If you haven&#8217;t heard of GIMP it is a free open source image editor much like Photoshop. It takes a bit of getting used to as does Photoshop I imagine &#8211; but I like it\u00a0 Its website says:<\/p>\n<blockquote><p>GIMP is the GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages. (more&#8230;)<\/p><\/blockquote>\n<h3>Setup<\/h3>\n<table class=\"zsteps\" border=\"0\">\n<tbody>\n<tr>\n<td>1.<\/td>\n<td>Install GIMP. I used the 32\/64bit version of GIMP 2.6.10:<\/p>\n<p style=\"padding-left: 30px;\">gimp-2.6.10-setup.exe<\/p>\n<p>As a 64bit app it installed to:<\/p>\n<p style=\"padding-left: 30px;\">C:\\Program Files\\GIMP 2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Get the Fourier plugin for GIMP from Git Hub. It is located in the folder:<\/p>\n<p style=\"padding-left: 30px;\"><a  href=\"https:\/\/github.com\/pixlsus\/registry.gimp.org_static\/tree\/master\/registry.gimp.org\/files\">https:\/\/github.com\/pixlsus\/registry.gimp.org_static\/tree\/master\/registry.gimp.org\/files<\/a><\/p>\n<p>There are a huge number of files at this location so you need to click on the find button to find the one you want. The find button is currently:<\/p>\n<p style=\"padding-left: 30px;\"><a  href=\"https:\/\/github.com\/pixlsus\/registry.gimp.org_static\/find\/master\">https:\/\/github.com\/pixlsus\/registry.gimp.org_static\/find\/master<\/a><\/p>\n<p>When this article was originally written I used version 0.4.1 but that was a while ago and that version is not available. I would suggest <strong>fourier-0.4.3-win64.zip<\/strong> which is at:<\/p>\n<p><a  href=\"https:\/\/github.com\/pixlsus\/registry.gimp.org_static\/blob\/master\/registry.gimp.org\/files\/fourier-0.4.3-win64.zip\">https:\/\/github.com\/pixlsus\/registry.gimp.org_static\/blob\/master\/registry.gimp.org\/files\/fourier-0.4.3-win64.zip<\/a><\/p>\n<p>Note: If you are running GIMP in 32bit mode then you need the 32bit version of the<br \/>\nFourier transfrom plugin. In my case I was running GIMP in 64bit mode.<\/td>\n<\/tr>\n<tr>\n<td>3.<\/td>\n<td>Unzip the Fourier plugin and copy the 32bit version of &#8220;fourier.exe&#8221; and put in:<\/p>\n<p style=\"padding-left: 30px;\">C:\\Program Files (x86)\\GIMP-2.0\\lib\\gimp\\2.0\\plug-ins<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>4.<\/td>\n<td>Copy &#8220;libfftw3-3.dll&#8221; from the same source directory as &#8220;fourier.exe&#8221; and put this in:<\/p>\n<p style=\"padding-left: 30px;\">C:\\Program Files (x86)\\GIMP-2.0\\bin<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>5.<\/td>\n<td>Get the descreen plugin:<\/p>\n<p style=\"padding-left: 30px;\"><a  href=\"http:\/\/registry.gimp.org\/node\/24411\" target=\"_blank\" rel=\"noopener\">http:\/\/registry.gimp.org\/node\/24411<\/a><\/p>\n<p>This should be descreen.scm<\/td>\n<\/tr>\n<tr>\n<td>6.<\/td>\n<td>Copy &#8220;descreen.scm&#8221; to:<\/p>\n<p style=\"padding-left: 30px;\">C:\\Program Files (x86)\\GIMP-2.0\\share\\gimp\\2.0\\scripts<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>7.<\/td>\n<td>You need to edit &#8220;descreen.scm&#8221;<\/p>\n<table class=\"zsteps2\" border=\"0\">\n<tbody>\n<tr>\n<td>a.<\/td>\n<td>On line 76 change:<\/p>\n<p style=\"padding-left: 30px;\">(if despeckle<\/p>\n<p>to<\/p>\n<p style=\"padding-left: 30px;\">(if (= despeckle TRUE)<\/p>\n<p>&#8211; This makes the speckle box perform correctly. otherwise it always despeckle<\/td>\n<\/tr>\n<tr>\n<td>b.<\/td>\n<td>Line 62 change;<\/p>\n<p style=\"padding-left: 30px;\">Foreground color has been set by the FFT plugin to #808080<br \/>\n(gimp-edit-fill drawable 0)<\/p>\n<p>to<\/p>\n<p style=\"padding-left: 30px;\">; Foreground color has been set by the FFT plugin to #808080<br \/>\n(gimp-context-set-foreground \u2018(128 128 128)) ; midgray 0\u00d70808080 ; suggested fix by R. S. Shaw<br \/>\n(gimp-edit-fill drawable 0)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>c.<\/td>\n<td>We need to set the defaults to what we like so<\/p>\n<p style=\"padding-left: 30px;\">changeSF-ADJUSTMENT \u201cSensitivity\u201d \u2018(72 1 128 1 16 0 SF-ROLLBOX)<\/p>\n<p>to<\/p>\n<p style=\"padding-left: 30px;\">SF-ADJUSTMENT \u201cSensitivity\u201d \u2018(90 1 128 1 16 0 SF-ROLLBOX)<\/p>\n<p>And change<\/p>\n<p style=\"padding-left: 30px;\">SF-VALUE \u201cRatio for middle preservation\u201d \u201c5\u2033<\/p>\n<p>to<\/p>\n<p style=\"padding-left: 30px;\">SF-VALUE \u201cRatio for middle preservation\u201d \u201c4\u2033<\/p>\n<p>Also<\/p>\n<p style=\"padding-left: 30px;\">SF-TOGGLE \u201cDespeckle\u201d TRUE<\/p>\n<p>to<\/p>\n<p style=\"padding-left: 30px;\">SF-TOGGLE \u201cDespeckle\u201d FALSE<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>8.<\/td>\n<td>You may possibly need to be careful whether you save this file in DOS or Unix<br \/>\nformat &#8211; as in what constitutes end of line.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>Running the descreener<\/h2>\n<p>Select &#8220;Descreen&#8221; from the GIMP menu:<\/p>\n<p style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection14.jpg\" class=\"thickbox no_icon\" title=\"Descreen Menu Option\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1560\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection14.jpg\" alt=\"Descreen Menu Option\" width=\"778\" height=\"334\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection14.jpg 778w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection14-150x64.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection14-300x128.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection14-500x214.jpg 500w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/a>The default settings are:<\/p>\n<p><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection15.gif\" class=\"thickbox no_icon\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1572\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/09\/MoireCorrection15.gif\" alt=\"\" width=\"325\" height=\"233\" \/><\/a>However you might want to try:<\/p>\n<p>Sensitivity: 90<br \/>\nSelection growth: 16<br \/>\nRatio for middle preservation: 3<br \/>\nDespeckle: off<\/p>\n<h2>Thanks<\/h2>\n<p>Got an email on 8th May 2020 with suggestions from Joe &#8211; Thanks very much<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A moir\u00e9 pattern typically occurs when you scan a printed picture and then view or print out that scan. The above picture is a classic example. This discusses how to use GIMP to remove, or mostly remove from your scan, the typical underlying cause of moir\u00e9 patterns. The process we are going to use is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1575,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[147,178],"tags":[],"class_list":["post-1529","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cd-archiving","category-gimp"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/1529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1529"}],"version-history":[{"count":37,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/1529\/revisions"}],"predecessor-version":[{"id":4222,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/1529\/revisions\/4222"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/1575"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1529"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}