Is there any raster graphics editor which can do the standard things, like rasterizing fonts, drawing shapes, working with layers, etc. but is also easy to extend with custom 'filters' (i.e. algorithms on a pixel matrix)? I know that Photoshop is extendable, via scripts and via Lua for actual plugins, that Lua route seemed a bit overkill for me to learn (with all the GUI stuff), and with scripts, I don't know how effectively one can read and write image data. GPU acceleration and being free software would be sweet, but not mandatory. Ideally, I'd like to write the filters in Python, being able to use the OpenCV and Pillow libraries. Also, it would great if it would be possible to create filters with more than one input layer, so that you can e.g. apply a filter on two layers that are fed seperately into the algorithm (and possibly treated in different ways) to produce one output image.
As a simple example, assume I want to perform convolution to a layer, but with a different convolution matrix for each pixel. Say, the convolution matrix is the polynomial ax+by+cxy multiplied with some bump map and the parameters a, b, c are taken from the RGB values of another layer. It wouldn't be hard to write a Python script that takes two images and performs exactly this, also GPU acceleration is feasible, but I'd like to integrate it smoothly into the workflow of some design software, it must not be the most powerful, but should cover the basic features.
[EDIT] OK, so I just learned there is GIMP Python, which should be basically what I was looking for. Also, apparently there is an image editor in Blender, which is also Python extendable. Still, I leave this open, just in case there are other options I don't know of yet, or someone can comment on how it feels to do it in Photoshop, which is not free, of course, but still the software I'm most familiar with!