def get_palette(self, color_count=10, quality=10):
        image = self.image.convert('RGBA')
        width, height = image.size
        pixels = list(image.getdata())
        pixel_count = width * height
        valid_pixels = []
        for i in range(0, pixel_count, quality):
            r, g, b, a = pixels[i]
            # If pixel is mostly opaque and not white
            if a >= 125:
                if not (r > 250 and g > 250 and b > 250):
                    valid_pixels.append((r, g, b))

        # Send array to quantize function which clusters values
        # using median cut algorithm
        cmap = MMCQ.quantize(valid_pixels, color_count)
        return cmap.palette
Z - MxQ
dataset/ETHPy150Open fengsp/color-thief-py/colorthief.py/ColorThief.get_palette--crossover with--dataset/ETHPy150Open SheffieldML/GPy/GPy/kern/src/psi_comp/ssrbf_psi_comp.py/_psi2computations