{"id":1540,"date":"2010-03-20T20:42:14","date_gmt":"2010-03-20T20:42:14","guid":{"rendered":"http:\/\/wiki.davelevy.info\/?p=1540"},"modified":"2010-03-20T20:42:14","modified_gmt":"2010-03-20T20:42:14","slug":"using-boomy-icons-with-tcltk","status":"publish","type":"post","link":"https:\/\/davelevy.info\/prototype\/2010\/03\/20\/using-boomy-icons-with-tcltk\/","title":{"rendered":"Using &quot;boomy&quot; icons with tcl\/tk"},"content":{"rendered":"<p>I spent some time over the last few days trying to populate the TK images folder with a usable image library. <del>The activestate version and the standard only permits the use of .gif images in the image manipulation commands.<\/del> (Not true now, see the comments!) <del>I might need to look at the <a href=\"http:\/\/sourceforge.net\/projects\/tkimg\/\">tkImg package<\/a> to use an alternative format.<\/del><!--more--><\/p>\n<h3>Using ImageMagick to create .gif from .png<\/h3>\n<p>I wanted to use the <a href=\"https:\/\/web.archive.org\/web\/20200809234621\/http:\/\/www.freeiconsweb.com\/toolbar_Icons.htm\">Boomy icon set<\/a>. This comes in .gif, .ico and .png. The .png is really good. The .gif has the wrong transparency colour set and so needs conversion. There are quite a lot so I wanted to use a batch operation.<br \/>\nI chose to use <a href=\"http:\/\/www.imagemagick.org\/script\/index.php\">ImageMagick<\/a>. I used cygwin shell to manage the batch logic. I chose to use the .png icons as my source.<\/p>\n<pre>convert accept.png accept.gif<\/pre>\n<p>is the code rune that works, where accept is the name of the icon. So I created a directory containing the source images. I symlinked the <b>Program Files<\/b> folder to a new folder in the cywin $HOME folder, I called it <b>imbin. N.B.<\/b> dos has a convert command so you need to manage the PATH well, but I decided to explicitly invoke the command by its full hierarchical name. Here&#8217;s my code<\/p>\n<pre># I have symlinked the folder to $HOME\/imbin\nCONVERT=$HOME\/imbin\/convert.exe\n[ -x $CONVERT ] &amp;&amp; echo $CONVERT is executable\ncd im\nfor i in `ls *.png`\ndo\n    echo -n processing ${i%.png}\n    ${CONVERT} $i ${i%.png}.gif\n    echo \u2026 done\ndone<\/pre>\n<p>I blogged about this on <a href=\"http:\/\/blog.davelevy.info\/2009\/12\/04\/wish-boomy-icons-and-imagemagick\/\">4th Dec 2009<\/a>. This included the following words, which I then deleted from the blog.<\/p>\n<blockquote><p>Does TCL &#8216;image create&#8217; work with .bmp files. It claims to support bit maps but I suspect that these are an old\/ancient standard, I have tested the image create statement with .jpg, .png and .bmp files and none of these work, I have also tried to use the -format flag and this fails to find the filters.I have created a .gif file with transparency by converting the .png, (using GIMP) and now may want to do this as a batch operation, although the quality of the edges is a bit poor.<\/p><\/blockquote>\n<p>I have just done this to the home server since I have written a new TCL script which I need on all my computers. Imagemagick now writes its location into the windows $PATH variable, so all the mucking about to ensure that the ksh interpreter can run the imagemagick convert program is no longer required. <em>20 March 2010<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent some time over the last few days trying to populate the TK images folder with a usable image library. The activestate version and the standard only permits the use of .gif images in the image manipulation commands. (Not true now, see the comments!) I might need to look at the tkImg package to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_share_on_mastodon":"0"},"categories":[41,27],"tags":[175,209,751,761,762,853,1216,1414,1502,1513],"class_list":["post-1540","post","type-post","status-publish","format-standard","hentry","category-software","category-technology","tag-bash","tag-boomy-icons","tag-icons","tag-imagemagick","tag-images","tag-ksh","tag-programming","tag-software","tag-tcltk","tag-technology"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/posts\/1540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/comments?post=1540"}],"version-history":[{"count":0,"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/posts\/1540\/revisions"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/media?parent=1540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/categories?post=1540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/prototype\/wp-json\/wp\/v2\/tags?post=1540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}