I am just getting familiar with Boost GIL (and image processing in general) and suspect that this is simple, but I haven't found the relevant documentation.
I have a set of image views that I would like to combine with an arbitrary function. For simplicity, lets say the images are aligned (same size and locator type) and I just want to add the pixel values together. One approach would be to create a combining iterator from a zip_iterator and a transform_iterator, but I'm guessing that there are image processing algorithms that are conveniently abstracted for this purpose.
The Mandelbrot example in the documentation is probably relevant, because it computes pixel values from a function, but I'm getting lost in the details and having trouble adapting it to my case.
The only binary channel algorithm I can find is
channel_multiply
.The algorithm you're probably really looking for is
transform_pixels
which does combine in a binary variation.Here's the simplest example I could make.
When a.png is and b.png is (note transparencies too), c.png became (again, note the transparencies).
You will want to fine-tune the transformation function to do something more useful suppose.