Good morning everyone!
For this Community Bonding period post, I want to write about what this project is about. I’ve gotten some questions about its scope and how it will benefit the Krita community, so a full writeup may help clarify these bits. As I’m a Computer Graphics student, this post may be biased towards the math-y bits, but I hope it’s still clear.
Let’s get started!
To understand what SeExpr is about, we need to differentiate between two types of graphics, raster and procedural.
The vast majority of the computer-generated stuff you see every day belong to the first type– images like photos, your favourite anime screenshots, memes, are all a multitude of tiny little dots of color arranged into a (usually) rectangular grid. We call these dots pixels, and obtain them by a two-fold process:
- sampling, where we get the color value at each grid cell;
- and quantization, where we turn these values into numbers that the computer can store and process.
Raster textures have two drawbacks. First, once you create them, they are fixed. You cannot get any more detail, there’s no enhancement à la CSI (unless using AI to imagine the missing details). And if you need to change the texture, either you go back to the source and sample it again (which is sometimes impossible), or edit it with a raster graphics program, like Krita.
But to us CG people, one of the biggest problems is that we are always limited by the space our programs can use; either secondary storage, like SD cards, or RAM. Unless compressed, image memory needs are quadratic in the size of the image. For a quick example, the Create new document dialog of Krita tells you three bits of information: its size in pixels, the size of the pixel itself, and the total memory needed.
Here’s a summary for square textures:
Procedural textures are a whole different thing. In practical terms, they are generated at runtime from a script.
There’s a book chock full of details on the subject, by Morgan Kaufmann: Texturing and Modeling: A Procedural Approach.
SeExpr is an expression language, designed by Disney Animation, that lets us do just this thing. Pixar calls it in its documentation a scriptable pattern generator and combiner.
In short, it lets artists turn a piece of code into a beautiful, lava-like noise pattern, as below:
The possibilities are simply too many to describe. This project will start by letting you render patterns like the above onto a Fill Layer. Once I get the render, UX, and storage working, I may add extras like dynamically binding additional inputs, or hooks to extend SeExpr with additional functions.
Roughly speaking, this project will be done in four parts:
- Researching SeExpr: how it’s implemented, what APIs and components exposes, etc. (I’m here)
- Integrating SeExpr into the building process (
3rdpartymodules, for us Krita devs)
- Developing the new layer
- Testing, testing, testing!
YES! Once I get a prototype up and running, and a build is made, I’ll need lots of testers for the UX bits.
But most importantly: I need examples! Up to now, SeExpr is used mostly with proprietary software: Pixar’s Renderman (wiki here), and Autodesk’s Maya. The only open-source software that supports SeExpr is INRIA’s compositing software, Natron. Fully free, open source examples that we can bundle with Krita, would go a long way towards showcasing this project.
That’s all from me! Next time, I’ll dissect the insides of the SeExpr library. Please chime in with any comments, amyspark @ #krita in the Freenode network.
Until next time,