From 9597d454bfd79584c759f47aab3a7c1abac2c6db Mon Sep 17 00:00:00 2001 From: Adrian Hill Date: Mon, 7 Feb 2022 23:17:56 +0100 Subject: [PATCH] Show input image in ASCII example --- docs/literate/ascii.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/literate/ascii.jl b/docs/literate/ascii.jl index 49267c8..89ecdfa 100644 --- a/docs/literate/ascii.jl +++ b/docs/literate/ascii.jl @@ -5,13 +5,14 @@ using Images using DitherPunk using TestImages -# When loading an image, we need to compensate for the aspect ratio of ASCII characters. img = testimage("cameraman") -img = imresize(img, ratio=(1//14, 1//6)) + +# When loading an image, we need to compensate for the aspect ratio of ASCII characters. +img = imresize(img; ratio=(1//14, 1//6)) # We then define an ASCII ramp and a corresponding grayscale color scheme of matching length. ascii_ramp = split(" .:-=+*#%@", "") -cs = Gray.(range(0, 1, length=10)) +cs = Gray.(range(0, 1; length=10)) # Dithering will return an `IndirectArray`: d = dither(img, FloydSteinberg(), cs)