Multiplying two images with different size is actually something not well defined, mathematically.
So, what G’MIC does is multiplying the images value by value in the order they appear, from left to right and top to bottom, while keeping the size of the first operand of the multiplication.
Maybe you were expecting something different, like “second operand is resized to the dimension of the first operand before multiplication”, but that would raise even more questions for the user :
- How resizing is performed ? is there any interpolation used ? If not, how the resized image is centered ? What if the first image has 3 channels, and the other 4 ? etc.
That’s the kind of question we don’t want to bother users with, so the G’MIC rules for all mathematical operations (
pow, …) that takes two images as operands are the same : value by value in the order they appear, while keeping the dimension of the first operand. And if the second operand has less values than the first, then values are repeated from the start after they’ve been all read.
For instance, the following example will darken every odd-numbered column, if your input image has an even number of column:
image.jpg (1,0.5) mul