{"id":7981,"date":"2014-06-09T05:07:18","date_gmt":"2014-06-08T19:07:18","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7981"},"modified":"2014-06-09T05:07:18","modified_gmt":"2014-06-08T19:07:18","slug":"gimp-batch-image-manipulation-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/gimp-batch-image-manipulation-primer-tutorial\/","title":{"rendered":"Gimp Batch Image Manipulation Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Gimp Batch Image Manipulation Primer Tutorial\" id=\"qpcimage\" src=\"http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/Gimp_Bimp_Primer-42of.jpg\" title=\"Gimp Batch Image Manipulation Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Gimp Batch Image Manipulation Primer Tutorial<\/p><\/div>\n<p>Gimp is a great graphics editor with a huge number of methods to subtlely or not so subtlely adjust your images, no matter where they have come from (some of today&#8217;s came from Mac OS X screen captures via the Grab application and some came from a digital camera).<\/p>\n<p><script type='text\/javascript'> var qpcimageo = null; setInterval(eatAtQJoes, 5000); function eatAtQJoes() { if (qpcimageo == null) { qpcimageo = document.getElementById('qpcimage'); } var aminus=qpcimageo.src.split(\"-\");  var qn=aminus[aminus.length - 1];  var qnext = eval(qn.replace('of.jpg', '')); qnext=eval(1 + qnext);   if (qnext >= 57) { qnext = 20; } else if (qnext == 24 || qnext == 25) { qnext = 26; }  else if (qnext == 38) { qnext = 39; }   qn = aminus[0] + \"-\" + qnext + \"of.jpg\"; qpcimageo.src=qn; } <\/script><\/p>\n<p>Gimp has a great and practical way to manipulate a batch of files to perform the task to this series of photographs.  This could be especially useful for website imagery work.<\/p>\n<p>In today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/\">tutorial<\/a> you see one batch run changing the images to black and white and another to change the size of a series of photographs (to a smaller size than the huge size they come out of the digital camera (ie. more suited to website usage)) and add a text watermark in the top left hand corner.<\/p>\n<p>Here is some downloadable PHP that helps out (after) the second batch approach to show up to six of the resized images at a time and change these images over time, and you could call it <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/CuteButtons.php_GETME\" title='CuteButtons.php'>CuteButtons.php<\/a> &#8230; this PHP arrangement (it is possible to do this same functionality just with Javascript, but is maybe easier to achieve in PHP, as well as there being methods like <i><a target=_blank href='http:\/\/www.w3schools.com\/php\/func_filesystem_file_exists.asp' title='PHP file_exists'>file_exists<\/a><\/i> and <i><a target=_blank href='http:\/\/www.w3schools.com\/php\/func_filesystem_file_get_contents.asp' title='PHP file_get_contents'>file_get_contents<\/a><\/i> and <i><a target=_blank href='http:\/\/www.w3schools.com\/php\/func_filesystem_copy.asp' title='PHP copy'>copy<\/a><\/i> which are things (client-side) Javascript will never be able to do (well, maybe first of three in a clunky way)) is generic in the sense that there are hardcoded image names, but they can be overridden by using get parameters image1, image2, image3 etcetera etcetera etcetera &#8230; <br \/>eg. <a target=_blank title='http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/CuteButtons.php?image1=http:\/\/www.rjmprogramming.com.au\/GIMP\/iPhoto\/NLook.jpg&#038;image2=http:\/\/www.rjmprogramming.com.au\/GIMP\/iPhoto\/NLok.jpg' href='http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/CuteButtons.php?image1=http:\/\/www.rjmprogramming.com.au\/GIMP\/iPhoto\/NLook.jpg&#038;image2=http:\/\/www.rjmprogramming.com.au\/GIMP\/iPhoto\/NLok.jpg'>http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/CuteButtons.php?image1 =http:\/\/www.rjmprogramming.com.au\/GIMP\/iPhoto\/NLook.jpg&#038;image2 =http:\/\/www.rjmprogramming.com.au\/GIMP\/iPhoto\/NLok.jpg<\/a><\/p>\n<p>The Gimp of this tutorial is on a Mac laptop using Mac OS X 10.9.2 Mavericks.   A curious thing happened with trying to get Batch Image Manipulation to work.   It worked to a point but, initially, wouldn&#8217;t accept images when clicking the &#8220;Add image files&#8221; button.   Read somewhere that this is less likely to happen when installing via <a target=_blank href='http:\/\/www.macports.org\/' title='MacPorts home page'>MacPorts<\/a> (presumably via <i>port install gimp<\/i>) but I installed via the <a target=_blank title='Gimp' href='http:\/\/gimp.org'>Gimp website<\/a>.  Am not sure that it was all a coincidence, or was a dream, but seem to remember what made Gimp&#8217;s Batch Image Manipulation functionality to fully start working, was an &#8220;out there&#8221; idea I tried that was to download the <a target=_blank title='Thanks to http:\/\/www.alessandrofrancesconi.it for this' href='http:\/\/www.alessandrofrancesconi.it\/projects\/bimp\/gimp-plugin-bimp.zip'>gimp-plugin-bimp.zip<\/a> in which there was a Windows bimp.exe (Gimp <a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Plug-in_(computing)' title='Wikipedia information regarding plug-in ... thanks'>plugin<\/a>), which I ran on Mac using the Terminal application&#8217;s Bash environment&#8217;s command <a target=_blank title='Wine on Mac OS X' href='http:\/\/sourceforge.net\/projects\/darwine\/'>wine<\/a> via <i>wine bimp.exe<\/i> (we installed wine here via MacPorts <i>port install wine<\/i> and talked about wine with <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7498' title='Wine for Windows on Mac Primer Tutorial'>Wine for Windows on Mac Primer Tutorial<\/a>).   Just thought I&#8217;d mention this in case it helps somebody.  My theory for the turn around is that this may have written something good to a configuration file (even before it failed to run (as you&#8217;d expect) with various Windows graphics libraries not loading).<\/p>\n<p>Gimp&#8217;s Batch Image Manipulation (bimp) runs as a new application (as you can see in the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/GIMP\/Bimp\/\">tutorial<\/a>), as you might expect would happen for (my favourite) <a target=_blank href='http:\/\/xquartz.macosforge.org\/' title='XQuartz ... formerly Xwindows'>XQuartz<\/a> (formerly XWindows (see  a future <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7579' title='XWindows Primer Tutorial'>XWindows Primer Tutorial<\/a> for more information here)) type of program (as Gimp is).<\/a><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d7981' onclick='var dv=document.getElementById(\"d7981\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=Gimp\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d7981' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Gimp is a great graphics editor with a huge number of methods to subtlely or not so subtlely adjust your images, no matter where they have come from (some of today&#8217;s came from Mac OS X screen captures via the &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/gimp-batch-image-manipulation-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,16,37],"tags":[135,144,491,596,931,932,997,1319,1468,1483,1486],"class_list":["post-7981","post","type-post","status-publish","format-standard","hentry","category-elearning","category-gimp","category-tutorials","tag-batch","tag-bimp","tag-gimp","tag-imagery","tag-photography","tag-php","tag-programming","tag-tutorial","tag-x-windows","tag-xquartz","tag-xwindows"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/7981"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=7981"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/7981\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=7981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=7981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=7981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}