From 7677d6faf5272579808335a3b0cb93fbba861552 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 10 Jul 2024 00:01:25 +0200 Subject: [PATCH] pic: Improve rendered image quality by reducing the line thickness of each pixel to minimize overlap --- README.md | 2 +- src/render/pic.rs | 2 +- src/test_annex_i_micro_qr_as_pic.pic | 2 +- src/test_annex_i_qr_as_pic.pic | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bb0ce61..2864c32 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ output that renders as follows: ```pic maxpswid=29;maxpsht=29;movewid=0;moveht=1;boxwid=1;boxht=1 -define p { box wid $3 ht $4 fill 1 with .nw at $1,-$2 } +define p { box wid $3 ht $4 fill 1 thickness 0.1 with .nw at $1,-$2 } box wid maxpswid ht maxpsht with .nw at 0,0 p(4,4,1,1) p(5,4,1,1) diff --git a/src/render/pic.rs b/src/render/pic.rs index 794ea33..b715ce5 100644 --- a/src/render/pic.rs +++ b/src/render/pic.rs @@ -44,7 +44,7 @@ impl RenderCanvas for Canvas { pic: format!( concat!( "maxpswid={w};maxpsht={h};movewid=0;moveht=1;boxwid=1;boxht=1\n", - "define p {{ box wid $3 ht $4 fill 1 with .nw at $1,-$2 }}\n", + "define p {{ box wid $3 ht $4 fill 1 thickness 0.1 with .nw at $1,-$2 }}\n", "box wid maxpswid ht maxpsht with .nw at 0,0\n", ), w = width, diff --git a/src/test_annex_i_micro_qr_as_pic.pic b/src/test_annex_i_micro_qr_as_pic.pic index a2bed16..433ba4f 100644 --- a/src/test_annex_i_micro_qr_as_pic.pic +++ b/src/test_annex_i_micro_qr_as_pic.pic @@ -1,5 +1,5 @@ maxpswid=17;maxpsht=17;movewid=0;moveht=1;boxwid=1;boxht=1 -define p { box wid $3 ht $4 fill 1 with .nw at $1,-$2 } +define p { box wid $3 ht $4 fill 1 thickness 0.1 with .nw at $1,-$2 } box wid maxpswid ht maxpsht with .nw at 0,0 p(2,2,1,1) p(3,2,1,1) diff --git a/src/test_annex_i_qr_as_pic.pic b/src/test_annex_i_qr_as_pic.pic index 7ab7031..c30aac6 100644 --- a/src/test_annex_i_qr_as_pic.pic +++ b/src/test_annex_i_qr_as_pic.pic @@ -1,5 +1,5 @@ maxpswid=232;maxpsht=232;movewid=0;moveht=1;boxwid=1;boxht=1 -define p { box wid $3 ht $4 fill 1 with .nw at $1,-$2 } +define p { box wid $3 ht $4 fill 1 thickness 0.1 with .nw at $1,-$2 } box wid maxpswid ht maxpsht with .nw at 0,0 p(32,32,8,8) p(40,32,8,8)