示例#1
0
def create_blurred_palette(enc_palette, stdev):
    pal = genome.palette_decode(enc_palette)
    y, uvr, uvt, a = Palette.rgbtoyuvpolar(pal)
    uvt = gaussian_filter1d(uvt, stdev)
    y, uvr, a = [gaussian_filter1d(ch, stdev * 0.5) for ch in y, uvr, uvt]
    return genome.palette_encode(Palette.yuvpolartorgb(y, uvr, uvt, a))
示例#2
0
def create_blurred_palette(enc_palette, stdev):
    pal = genome.palette_decode(enc_palette)
    y, uvr, uvt, a = Palette.rgbtoyuvpolar(pal)
    uvt = gaussian_filter1d(uvt, stdev)
    y, uvr, a = [gaussian_filter1d(ch, stdev * 0.5) for ch in y, uvr, uvt]
    return genome.palette_encode(Palette.yuvpolartorgb(y, uvr, uvt, a))
示例#3
0
def palflip(gnm):
    for v in gnm["xforms"].values():
        c = v["color"]
        v["color"] = SplEval([0, c(0), 1, 1 - c(1)], c(0, 1), -c(1, 1))
    pal = genome.palette_decode(gnm["palettes"][1])
    gnm["palettes"][1] = genome.palette_encode(np.flipud(pal))
示例#4
0
def palflip(gnm):
    for v in gnm['xforms'].values():
        c = v['color']
        v['color'] = SplEval([0, c(0), 1, 1 - c(1)], c(0, 1), -c(1, 1))
    pal = genome.palette_decode(gnm['palettes'][1])
    gnm['palettes'][1] = genome.palette_encode(np.flipud(pal))