Skip to content

Commit

Permalink
pic: Improve rendered image quality
Browse files Browse the repository at this point in the history
by reducing the line thickness of each pixel to minimize overlap
  • Loading branch information
afh committed Jul 9, 2024
1 parent 0695f03 commit 7677d6f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/render/pic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/test_annex_i_micro_qr_as_pic.pic
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/test_annex_i_qr_as_pic.pic
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 7677d6f

Please sign in to comment.