Skip to content

Commit ff1db8c

Browse files
committed
common fixes
1 parent fb8f2e8 commit ff1db8c

File tree

17 files changed

+210
-1164
lines changed

17 files changed

+210
-1164
lines changed

README.md

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ A modern, customizable system information display tool with image rendering capa
77
<a href="#installation">Installation</a> •
88
<a href="#usage">Usage</a> •
99
<a href="#configuration">Configuration</a> •
10+
<a href="#image-rendering-and-dithering">Image Rendering</a> •
1011
<a href="#contributing">Contributing</a> •
1112
<a href="#license">License</a>
1213
</div>
@@ -15,6 +16,7 @@ A modern, customizable system information display tool with image rendering capa
1516

1617
- **System Information Display**: Shows detailed system information including OS, kernel, CPU, GPU, memory usage, and more
1718
- **Image Rendering**: Supports multiple image rendering protocols (Sixel, Kitty, iTerm2, Chafa)
19+
- **Advanced Dithering**: Implements Floyd-Steinberg dithering for improved image quality in terminals with limited color support
1820
- **ASCII Art Logos**: Display custom ASCII art logos alongside system information
1921
- **Customizable UI**: Configure colors, layout, and information displayed
2022
- **Cross-Platform**: Works on various Linux distributions
@@ -164,18 +166,26 @@ LunarFetch can be configured using a JSON configuration file located at `~/.conf
164166
- `random`: Randomly select an image from the `imagePath` directory (`true` or `false`)
165167
- `imagePath`: Path to image file or directory (for random selection)
166168
- `width`/`height`: Dimensions in terminal characters
167-
- `renderMode`: Image rendering detail level (`"detailed"`, `"simple"`, `"block"`, or `"ascii"`)
168-
- `ditherMode`: Dithering algorithm (`"none"` or `"floyd-steinberg"`)
169+
- `renderMode`: Image rendering detail level:
170+
- `"detailed"`: Highest quality rendering with maximum detail
171+
- `"simple"`: Simplified rendering with less detail
172+
- `"block"`: Uses block characters for better terminal compatibility
173+
- `"ascii"`: Converts image to ASCII characters only
174+
- `ditherMode`: Dithering algorithm:
175+
- `"none"`: No dithering applied
176+
- `"floyd-steinberg"`: Floyd-Steinberg dithering for better color representation
169177
- `terminalOutput`: Output to terminal directly (`true` or `false`)
170-
- `displayMode`: How to display the image (`"auto"`, `"block"`, or `"ascii"`)
178+
- `displayMode`: How to display the image:
179+
- `"auto"`: Automatically select the best display mode
180+
- `"block"`: Use block characters for display
181+
- `"ascii"`: Use ASCII characters only
171182
- `protocol`: Image display protocol:
172-
- `"auto"`: Auto-detect the best protocol
173-
- `"sixel"`: For terminals with Sixel support
174-
- `"kitty"`: For Kitty terminal
183+
- `"auto"`: Auto-detect the best protocol for your terminal
184+
- `"sixel"`: For terminals with Sixel support (like xterm with sixel extension)
185+
- `"kitty"`: For Kitty terminal using its graphics protocol
175186
- `"iterm2"`: For iTerm2 terminal on macOS
176-
- `"chafa"`: Uses the Chafa tool
187+
- `"chafa"`: Uses the Chafa tool (most compatible option)
177188
- `"uberzug"`: Uses Überzug (Linux only)
178-
- `"terminal-image"`: Uses the terminal-image tool
179189
- `scale`: Image scaling factor (integer)
180190
- `offset`: Offset from terminal edge (integer)
181191
- `background`: Background color (`"transparent"` or a color value)
@@ -433,6 +443,50 @@ Set any option to `false` to hide that specific information.
433443
```
434444
</details>
435445

446+
## 🎨 Image Rendering and Dithering
447+
448+
LunarFetch supports various image rendering techniques to display images in your terminal.
449+
450+
### Supported Image Formats
451+
452+
- PNG (`.png`)
453+
- JPEG (`.jpg`, `.jpeg`)
454+
- WebP (`.webp`)
455+
456+
### Image Rendering Protocols
457+
458+
LunarFetch supports multiple protocols for rendering images in the terminal:
459+
460+
1. **Chafa**: The most compatible option that works in virtually any terminal. Chafa converts images to colored text characters.
461+
462+
2. **Sixel**: A graphics format supported by terminals like xterm with sixel extension, mlterm, and mintty.
463+
464+
3. **Kitty Graphics Protocol**: A modern protocol for displaying images in the Kitty terminal.
465+
466+
4. **iTerm2 Graphics Protocol**: For displaying images in iTerm2 on macOS.
467+
468+
5. **Uberzug**: A Linux-specific tool for displaying images in the terminal.
469+
470+
### Understanding Dithering
471+
472+
Dithering is a technique used in image processing to create the illusion of color depth in images with a limited color palette. LunarFetch implements the Floyd-Steinberg dithering algorithm, which works as follows:
473+
474+
1. **Color Reduction**: When displaying images in terminals with limited color capabilities, dithering helps maintain visual quality while reducing the number of colors used.
475+
476+
2. **Error Diffusion**: The algorithm processes each pixel, finds the closest available color, and distributes the error (difference) to neighboring pixels according to a specific pattern:
477+
```
478+
X 7/16
479+
3/16 5/16 1/16
480+
```
481+
Where X is the current pixel, and the fractions represent how much of the error is distributed to each neighboring pixel.
482+
483+
3. **Visual Benefits**: Dithering creates patterns of dots that, when viewed from a distance, appear to have more colors than are actually used. This is particularly useful for:
484+
- Smooth gradients
485+
- Detailed images
486+
- Photos with subtle color variations
487+
488+
To enable dithering, set `"ditherMode": "floyd-steinberg"` in your configuration.
489+
436490
## 🤝 Contributing
437491

438492
Contributions are welcome! Please feel free to submit a Pull Request.

example-config-with-comments.txt

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)