The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.

Thanks a lot @el_supremo, you saved my a lot of time. Your solution works perfectly.
Just one quick question. How do I know that I need to pass the matrix in just as a String. I mean I couldn't found any documentation regarding it.
Could you please explain about it a bit?

That, and the comment header are usually enough to figure out what is going on. In this case the comment header explains the required format of the string.
When I'm trying to figure out how a command works, I dig through the code for MagickWand/mogrify.c which is used to make the 'magick' command (formerly known as 'convert').

Pete

Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.