def test_fx_red(ctx): #img = Image.new((64, 64)) # TODO make the gradient, oops black = RGBColor(0., 0., 0.) white = RGBColor(1., 1., 1.) img = gradient((64, 64), black, white) img = image_filter(lambda *a: black)(*img, channel=Channel.blue | Channel.green) ctx.compare(img, 'fx_red.miff')
def test_rose_contrast2(ctx): img = builtins.rose # -evaluate clamps after every operation img = image_filter(lambda px: (px.color - 0.125).clamped() * 2)(*img) ctx.compare(img, 'rose_contrast2.miff')
def test_rose_decontrast(ctx): img = builtins.rose # -evaluate clamps after every operation img = image_filter(lambda px: (px.color * 0.5).clamped() + 0.25)(*img) ctx.compare(img, 'rose_decontrast.miff')
def test_rose_set_gray(ctx): img = builtins.rose img = image_filter(lambda px: GrayColor(0.5))(*img) ctx.compare(img, 'rose_set_gray.miff')
def test_fx_rose_brighten(ctx): img = builtins.rose img = image_filter(lambda px: px.color * 1.5)(*img) ctx.compare(img, 'fx_rose_brighten.miff')
def test_fx_navy(ctx): img = Image.new((64, 64), fill=RGBColor(0., 0., 0.)) gray = RGBColor(0.5, 0.5, 0.5) img = image_filter(lambda *a: gray)(*img, channel=Channel.blue) ctx.compare(img, 'fx_navy.miff')