I understand the subtle "after six years you should've known" 😉, but I moved to ubuntu recently and I this is my first encounter with the problem.
I don't know where the attention span ends while reading my posts 😉 As I've written earlier, the phpinfo command said that the version of gd is "2.0 or higher". Now I know it should read "bundled (2.0.34 compatible)", but how should I've known. And there aren't any configuration switches in phpinfo output on kubuntu (maybe because of suhosin patch?). But I googled some more (it took some time) and ths is what I've learned about gd:
There are two versions of gd library. The mainstream gd library and the gd library developed by php developers. The second one has some extensions (imagecolormatch is one of them) which are not ported back to the mainstream version. Linux distributions based on Debian (like Kubuntu) use the mainstream version of gd in php5-gd package. There is however a method to recompile only this package to use bundled version (or to be more exact, recompile the whole php, but install only the bundled gd package). It is described here:
http://www.howtoforge.com/recompiling-php5-with-bundled-support-for-gd-on-ubuntu
It takes some compiling time, but otherwise it works.
Thanks