Python and pigment

Already the first week of my internship at Fluendo in Barcelona has passed. Time flies here currently… so much to learn and do. Fluendo and all the people working here are a really nice bunch of folks. I’m enjoying my time here!

The last few days I’ve been starting to learn Python and the pigment-API.

There’s some very nice stuff ahead for Elisa and pigment. It’s going to be a fun ride! Elisa has got a new website, check it out. Here’s a screencast of my first ever Python-program (also using pigment for the first time):


(click to play back, ogg/theora, ~3.9 MBytes)

While it is not meant to serve any real-world purpose, it is a mere vehicle of learning for me. Before I start with the real tasks (e.g. getting cairo/pango-utilization into pigment) this messing around is needed to understand features and limits of pigment.

For any questions either use the comments here, email me or join the channels #pigment and #elisa on Freenode.

Yesterday I went to the cinema with Thomas, Christian and David to see 300. A bloody movie… literally, but still good entertainment. Though they could have de-emphasize the decapitations-scenes… or the dismemberment some :)

11 Responses to “Python and pigment”

  1. obi Says:

    I’m not sure how and where their scopes overlap, but it seems that pigment is more or less the same as http://www.clutter-project.org - the major difference I guess is that pigment is in Python, I guess.

  2. MacSlow Says:

    @ obi: That’s true. clutter and pigment kind of cover the same use-cases for such a library of that kind. Also feature-wise they are very similar. But I’m not very experienced yet with clutter. Also my experience with pigment is still very young. pigment is actually written in ANSI C using gobject. Furthermore it provides a python-binding, which is used by Elisa, as does clutter. Here’s a rough feature-by-feature comparison:

    - both implemented in C
    - both leverage gobject, gstreamer, OpenGL
    - both offer bindings for Python
    - clutter already interfaces with cairo/pango, pigment will also start to do so in the next weeks
    - placement/rotation-wise clutter is strict 2D only at the moment (that might change), pigment is 3D
    - both heavily developed, commercially funded and OpenSource
    - clutter there’s already a gtk-widget, for pigment this is planned
    - both will be able to support gtk-widgets on surfaces/drawables once gtk offers offscreen-rendering
    - both have a pluggable rendering-backend (e.g. OpenGL, OpenGL|ES, directfb…)
    - both offer keyframed animation
    - clutter offers path-based animation, pigment will soon too
    - elisa (not pigment) will offer integration of backends like Ogre3D, OpenSceneGraph or the like
    - pigment will offer fragment/vertex-shader and GLSL support, clutter will perhaps too

    To my current knowledge this list is quite complete. But I’m always glad for corrections/additions.

    It’s a bit sad to see these two efforts pulling in the same direction, but not joining forces. Maybe this will change in the future… please note that this is pure speculation/wishing from my side.

  3. obi Says:

    @Macslow: That’s quite interesting, actually - I didn’t realize they were even more similar than I imagined. Guess I now have to take a closer look at pigment too. I echo your sentiments that it would be nice if they’d join forces, but I do realize this takes a lot of effort from both projects - I’ll be the last to judge them for it.

    Thank you for the comparison.

  4. Stojance Says:

    Hey MacSlow!

    It wouldn’t be a bad idea to release the code on these programs that you make. I really like to learn how these things go, OpenGL, Cairo and stuff. There aren’t much examples laying around, you know.

  5. MacSlow Says:

    @ Stojance: Most of my stuff is available. Check Projects or my page at fdo. The sources of my python/pigment learning-exercises are everything but helpful. They are mostly embarrassing, because I’m still learning python and know nothing of python’s best practices yet. If you want to get into python-coding with pigment just go and grab a recent pigment-release from here.

  6. mallum Says:

    Arg, I just stumbled on this post and comments, and theres actually a few things wrong and important things missing from your feature by feature comment. Namely;

    - Both are O/S but Clutter is LGPL and Pigment is GPL (https://core.fluendo.com/pigment/trac/browser/trunk/LICENSE.GPL?)
    - Clutter is in no way strict 2D, its always done 3D!!
    - Clutter also has Perl and Mono bindings (as well as python)

    I could go on but I wont :)

  7. MacSlow Says:

    @ mallum: Yeah, that licence-issue is a big one. I forgot that in my comparison-list. And that’s why I would currently not consider using pigment for my own personal stuff or stuff that’s meant to be used "outside" of a Fluendo-project. I told that a few people at Fluendo. We’ll see if they reconsider it. I hope so. The 3D-capabilites of pigment and clutter don’t really satisfy my needs (or better… wishes). But I know that both libraries are work-in-progress so that’s ok. The bindings I don’t care for that much personally (I really still don’t like Python :). I just stated them for people who might be interested in something different than C or C++. Since I will meet you at GUADEC (hopefully) anyway we should continue talking about these kind of things - and clutter in particular - there. There’s a lot of topics I would like to bring up.

  8. philn Says:

    For the record Pigment is now under LGPL (since last summer).

  9. karim Says:

    Hey,
    I am a new pigment user and I am developing a plug in for Elisa media centre and I am having problems in writing widgets code ,
    I have wrote a code that creates only a SectionMenuControl and a decorator that draw a link in it ,that’s all

    I want to use the widgets in the pigment toolkit but i don’t seem to get can any one help me ,i have searched for a tutorials on how to do it and nothing came on.

  10. MacSlow Says:

    @ karim: I’m not involved in pigment and elisa (now called moovida) in over two years now. You are much better off trying to contact the upstream developers on the official pigment- and moovida-mailing-lists (https://lists.moovida.com/mailman/listinfo)

  11. karim Says:

    thanks ,any way

Leave a Reply