mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
Luminance fix
luminance fix error
This commit is contained in:
@@ -47,9 +47,7 @@ class DisplayManager:
|
||||
options.disable_hardware_pulsing = True # Reduce flickering
|
||||
options.show_refresh_rate = False
|
||||
options.limit_refresh_rate_hz = 120 # Higher refresh rate
|
||||
|
||||
# Minimal GPIO slowdown for better performance
|
||||
options.gpio_slowdown = 1
|
||||
options.gpio_slowdown = 1 # Minimal GPIO slowdown
|
||||
|
||||
# Initialize the matrix
|
||||
self.matrix = RGBMatrix(options=options)
|
||||
@@ -61,9 +59,6 @@ class DisplayManager:
|
||||
self.image = Image.new('RGB', (self.matrix.width, self.matrix.height))
|
||||
self.draw = ImageDraw.Draw(self.image)
|
||||
|
||||
# Set matrix to use luminance correction for better color reproduction
|
||||
self.matrix.set_luminance_correct(True)
|
||||
|
||||
# Initialize font
|
||||
try:
|
||||
self.font = ImageFont.truetype("DejaVuSans.ttf", 14)
|
||||
@@ -124,6 +119,10 @@ class DisplayManager:
|
||||
|
||||
def draw_text(self, text: str, x: int = None, y: int = None, color: Tuple[int, int, int] = (255, 255, 255), small_font: bool = False) -> None:
|
||||
"""Draw text on the display with improved visibility."""
|
||||
# Create a new blank image for this text
|
||||
self.image = Image.new('RGB', (self.matrix.width, self.matrix.height))
|
||||
self.draw = ImageDraw.Draw(self.image)
|
||||
|
||||
# Ensure maximum brightness for text
|
||||
if isinstance(color, tuple) and len(color) == 3:
|
||||
# Increase brightness of colors while maintaining relative ratios
|
||||
|
||||
Reference in New Issue
Block a user