Skip to content

Commit 911f907

Browse files
authored
fix(avatar): correct mirroring by generating 8 pixels per row (#6)
Fixes #6 – Ensures proper mirroring by generating exactly 8 pixels per row before mirroring instead of 9. This prevents an unintended bitwise OR condition in the center column, which previously caused extra foreground pixels to appear. The fix restores correct symmetry in avatar rendering.
1 parent fcb3321 commit 911f907

File tree

6 files changed

+1
-1
lines changed

6 files changed

+1
-1
lines changed

arts/avatar_1.png

-4 Bytes
Loading

arts/avatar_2.png

-2 Bytes
Loading

arts/avatar_3.png

-10 Bytes
Loading

arts/avatar_4.png

0 Bytes
Loading

arts/avatar_5.png

2 Bytes
Loading

goavatar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func Make(input string, opts ...optFunc) image.Image {
9797
// generate the pixel pattern
9898
// loop over each pixel in the grid
9999
for y := 0; y < o.gridSize; y++ {
100-
for x := 0; x < o.gridSize/2+1; x++ {
100+
for x := 0; x < o.gridSize/2; x++ {
101101
// use bitwise operation to determine if a pixel should be colored
102102
pixelOn := (hash[y]>>(x%8))&1 == 1
103103

0 commit comments

Comments
 (0)