@staticmethod
def compare_entropy(start_slice, end_slice, slice, difference):
    """ Calculate the entropy of two slices (from the start and end
            of an axis), returning a tuple containing the amount that
            should be added to the start, and removed from the end
            of that axis.
            
            Based on the eponymous function from easy-thumbnails:
                https://git.io/fhqpT
        """
    from instakit.utils.stats import histogram_entropy
    start_entropy = histogram_entropy(start_slice)
    end_entropy = histogram_entropy(end_slice)
    if end_entropy and abs(start_entropy / end_entropy - 1) < 0.01:
        if difference >= slice * 2:
            return slice, slice
        half_slice = slice // 2
        return half_slice, slice - half_slice
    if start_entropy > end_entropy:
        return 0, slice
    else:
        return slice, 0
