GIMP has done such a good job filling the Photoshop-shaped hole in my software arsenal left during my transition from OS X to Ubuntu, that until today I forgot that I sometimes work with vector-based images, and for that I had been using Adobe Illustrator. The best free, as in both beer and speech, Illustrator alternative is Inkscape, a professional vector graphics editor available for Windows, OS X, and Linux.
I want to import an Adobe color palette (.aco file) into Inkscape.
This is not as straightforward as I expected. Without using a third party plugin, the solution is a multi-step process. Read on to learn how I did it.
Abraham Lincoln once famously said, “Everybody loves a compliment.” I suspect that if he had been a mathematician he would have loved complements, too. We’ve already seen what complements are and talked about the two most prolific: the radix complement and the diminished radix complement. Now it’s time to explore how we can leverage complements to do some really interesting integer arithmetic. Using complements we can subtract one positive integer from another or add a negative integer to a positive one by simply performing addition with two positive integers. The algorithm behind this black magic is called the Method of Complements.
By the time December of last year rolled around, my family had been participating in the World’s Biggest Marble Hunt for several months. During that time we had found many breathtaking marbles created by some of the most talented artists in the world including Geoffrey Beetem, Topher Reynolds, and Tucker Heebner. One artist whose iconic marbles we were never able to find due to proximity and timing was Chad Parker.
I am excited this evening. Why? Because I am finally getting back to some real Python development. While I have recently coded up some GIMP plug-ins, I haven’t really taken the time to properly set up my Python environment since making the switch from OS X to Ubuntu in December. Now I’ve got some Django programming to do, but before I can start installing any third party packages, I’ll need to install pip, the de facto package management system for installing and managing Python packages. Think of pip being to Python as apt is to Ubuntu. The main repository for Python software is PyPi, the Python Package Index.
In my last post about binary signed integers, I introduced the ones complement representation. At the time, I said that the ones complement was found by taking the bitwise complement of the number. My explanation about how to do this was simple: invert each bit, flipping 1 to 0 and vice versa. While it’s true that this is all you need to know in order to determine the ones complement of a binary number, if you want to understand how computers do arithmetic with signed integers and why they represent them the way they do, then you need to understand what complements are and how the method of complements allows computers to subtract one integer from another, or add a positive and negative integer, by doing addition with only positive integers.
In my last post, I briefly explained GIMP‘s scripting and plug-in system and the two most common ways to program custom extensions and scripts: Script-Fu and Python-Fu. Script-Fu, being the older of the two options, is well documented and the more widely used of the two. Not because I love the road less traveled, but because I love Python, I have chosen Python-Fu, a set of Python modules that serve as a wrapper for libgimp, as my platform for extending GIMP.
This post (and any I hopefully follow up with) are meant to track my progress as I learn my way around Python-Fu. Even while writing relatively simple scripts I have encountered gotchas and conflicting information about how to do things. Hopefully some of what I’ve discovered scouring both the web and Python source code will save other developers the time and frustration I’ve already paid.
For several years now, Adobe Photoshop has been the sole reason that I have continued to run Mac OS X. During that time, I have done the majority of my work in an Ubuntu instance running in a Parallels virtual machine. I’ve finally bitten the bullet and installed Ubuntu as the primary operating system on my MacBook Pro. I couldn’t be more pleased with how the transition has gone, and I regret not doing it earlier.