Exemple #1
0
def test_color_fx_math(ctx):
    gold = RGBColor.parse('gold')
    def gold_filter(self, *a):
        return gold * 0.7

    img = get_image('test.png')
    img[0].translucent = False
    img = evaluate(gold_filter, *img)
    ctx.compare(img, 'color_fx_math.miff')
Exemple #2
0
def test_color_fx_constant(ctx):
    gold = RGBColor.parse('gold')

    def gold_filter(self, *a):
        return gold

    img = get_image('test.png')
    img[0].translucent = False
    img = evaluate(gold_filter, *img)
    ctx.compare(img, 'color_fx_constant.miff')
Exemple #3
0
def test_color_fx_constant(ctx):
    gold = RGBColor.parse('gold')

    @image_filter
    def gold_filter(self, *a):
        return gold

    img = get_image('test.png')
    img[0].translucent = False
    img = gold_filter(*img)
    ctx.compare(img, 'color_fx_constant.miff')
Exemple #4
0
def test_color_fx_math(ctx):
    gold = RGBColor.parse('gold')

    @image_filter
    def gold_filter(self, *a):
        return gold * 0.7

    img = get_image('test.png')
    img[0].translucent = False
    img = gold_filter(*img)
    ctx.compare(img, 'color_fx_math.miff')
Exemple #5
0
def test_khaki_to_tomato(ctx):
    img = Image.new((100, 100), fill=RGBColor.parse('khaki'))
    img[0].replace_color(RGBColor.parse('khaki'), RGBColor.parse('tomato'))
    ctx.compare(img, 'canvas_opaque.miff')
Exemple #6
0
def test_wheat(ctx):
    img = Image.new((100, 100), fill=RGBColor.parse('wheat'))
    ctx.compare(img, 'canvas_wheat.miff')
Exemple #7
0
def test_khaki(ctx):
    img = Image.new((100, 100), fill=RGBColor.parse('khaki'))
    ctx.compare(img, 'canvas_khaki.miff')
Exemple #8
0
def test_color_colorize(ctx):
    img = get_image('test.png')
    img[0].translucent = False
    img = Colorize(RGBColor.parse('sienna'), 1.0)(*img)
    ctx.compare(img, 'color_colorize.miff')
Exemple #9
0
def test_khaki_to_tomato(ctx):
    img = Image.new((100, 100), fill=RGBColor.parse('khaki'))
    img[0].replace_color(RGBColor.parse('khaki'), RGBColor.parse('tomato'))
    ctx.compare(img, 'canvas_opaque.miff')
Exemple #10
0
def test_wheat(ctx):
    img = Image.new((100, 100), fill=RGBColor.parse('wheat'))
    ctx.compare(img, 'canvas_wheat.miff')
Exemple #11
0
def test_khaki(ctx):
    img = Image.new((100, 100), fill=RGBColor.parse('khaki'))
    ctx.compare(img, 'canvas_khaki.miff')
Exemple #12
0
def test_color_colorize(ctx):
    img = get_image('test.png')
    img[0].translucent = False
    img = Colorize(RGBColor.parse('sienna'), 1.0)(*img)
    ctx.compare(img, 'color_colorize.miff')