def map_alpha_at_same_positions(callable_obj, *alpha_values_from_multiple_masks):
    """Return values by operating on multiple alpha values.

    That is, we take the alpha values of multiple masks
    and return a new alpha values list by grabbing the
    alpha values at the same positions and creating a new
    one from them using a given callable.

    Parameters
    ==========

    callable_obj (callable)
        operation which returns a new alpha value, given
        an tuple with all the alpha values for pixels in
        the same position.
    alpha_values_from_multiple_masks (sequence)
        contains alpha values of from multiple masks;
        the values may all be in their full format (integers
        in range(256)) or all in their unit format (floats
        from 0.000... to 1.0).

        the alpha values may have different sizes, resulting
        in alpha values whose dimensions are the smallest
        dimensions among the dimensions of the given alpha
        values.
    """
    ### return a list of lists representing the resulting
    ### alpha values

    return [
        ## inner list represents the alpha values (either in
        ## full or unit format) for a column of pixels
        [
            ## each item in this inner list is an alpha value
            ## resulting from a call to the given callable
            ## with a tuple containing all alpha values in that
            ## position from each mask
            callable_obj(values)
            for values in zip(*columns)
        ]
        ## the columns of pixels are retrieved from the
        ## collections representing alpha values from
        ## multiple masks, zipped together so columns in
        ## the same position are processed together
        for columns in zip(*alpha_values_from_multiple_masks)
    ]
Return values by operating on multiple alpha values.

    That is, we take the alpha values of multiple masks
    and return a new alpha values list by grabbing the
    alpha values at the same positions and creating a new
    one from them using a given callable.

    Parameters
    ==========

    callable_obj (callable)
        operation which returns a new alpha value, given
        an tuple with all the alpha values for pixels in
        the same position.
    alpha_values_from_multiple_masks (sequence)
        contains alpha values of from multiple masks;
        the values may all be in their full format (integers
        in range(256)) or all in their unit format (floats
        from 0.000... to 1.0).

        the alpha values may have different sizes, resulting
        in alpha values whose dimensions are the smallest
        dimensions among the dimensions of the given alpha
        values.
    
nodezator/alphamask/masksop.py