Skip to content

Commit

Permalink
Merge pull request #85 from matrix-org/michaelk/image_quality_issues
Browse files Browse the repository at this point in the history
Ensure we have enough image space to handle images that compress weirdly.
  • Loading branch information
michaelkaye authored Aug 31, 2023
2 parents 792dd7e + fb27f10 commit c610a0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trafficlight/internals/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ def video_image_colour(self) -> VideoImage:
# We match the source 255 as "higher than 247" because the video codec reduces the detail on the exact hue.

# These capture the expected values for the RED GREEN and BLUE images
if pixel[0] > 245 and pixel[1] < 10 and pixel[2] < 10 and pixel[3] == 255:
if pixel[0] > 213 and pixel[1] < 25 and pixel[2] < 25 and pixel[3] == 255:
return VideoImage.RED
if pixel[0] < 10 and pixel[1] > 245 and pixel[2] < 10 and pixel[3] == 255:
if pixel[0] < 25 and pixel[1] > 213 and pixel[2] < 25 and pixel[3] == 255:
return VideoImage.GREEN
if pixel[0] < 10 and pixel[1] == 0 and pixel[2] > 245 and pixel[3] == 255:
if pixel[0] < 25 and pixel[1] < 25 and pixel[2] > 213 and pixel[3] == 255:
return VideoImage.BLUE

# This captures video streams that have frozen on the initial state
Expand Down

0 comments on commit c610a0f

Please sign in to comment.