github / github/gh-skyline

[Feature]: Enhance text embossing with grayscale height mapping

Open
#13 0 comments 0 reactions 1 assignee Claimed by @chrisreddington View on GitHub
enhancement good first issue help wanted
Dominant language
Go
Stars
1.3k
Forks
101
PR merge metrics
No merged PRs in 30d

Description

# Description

Currently, the text rendering in `gh-skyline` uses a binary threshold for pixel values when creating the 3D text geometry. This results in a "hard" embossing effect where pixels are either fully raised or not at all. We can improve the visual quality by using the pixel's grayscale/whiteness value to determine the embossing height, which would preserve font anti-aliasing in the 3D output.

# Requirements

- Modify the text rendering logic to use pixel whiteness values (0-1) to scale embossing height
- Update `isPixelActive()` to return a float value representing pixel intensity instead of boolean
- Scale the voxel depth based on the pixel intensity value
- Maintain backward compatibility with existing cube generation functions
- Handle edge cases (completely black/white pixels) appropriately

# Definition of Done

- [x] Text rendering uses grayscale values to determine embossing height
- [ ] Anti-aliased edges of text are preserved in the 3D output
- [x] Documentation is updated to reflect the new behavior
- [x] Unit tests cover various pixel intensity scenarios
- [ ] Visual regression tests show improved quality at text edges

# Additional Notes

- Consider adding a configuration option to toggle between binary and grayscale modes
- Pixel intensity calculation should account for RGB channels appropriately
- May need to adjust overall embossing depth to maintain visual balance
- Consider impact on STL file size due to increased geometry complexity

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.