Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

black and white mode #1713

Closed
totaam opened this issue Nov 29, 2017 · 4 comments
Closed

black and white mode #1713

totaam opened this issue Nov 29, 2017 · 4 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Nov 29, 2017

We already have "png/L" support, but we could add a global black-and-white mode to try to save bandwidth:

  • jpeg supports TJPF_GRAY
  • all the video encoders would need a csc step
  • webp would need csc too

I'm not sure this will save enough bandwidth: the self-tuning video encode heuristics normally switch to YUV420P for video, and that already reduces the space taken by the colours to 33% or less of the bitstream.
For non-video, it may allow us to use a lossless encoding more often than we would otherwise.

@totaam
Copy link
Collaborator Author

totaam commented Dec 27, 2017

I don't see the point:

  • many things don't degrade well
  • none of the video encoders take grayscale as input
  • the cost of chroma is a small overhead (just a 33% with YUV420P - worst case scenario - often less if the video encoder interpolates chroma and luma)
  • the cost of a single lossless refresh dwarfs any savings we might have made at that point - best to make efficient use of the encodings we have than to invent new ones

@totaam
Copy link
Collaborator Author

totaam commented Sep 23, 2018

Let's give it a go: libyuv does have a ARGBGrayTo function we can use for video and webp codecs.

@totaam
Copy link
Collaborator Author

totaam commented Jun 11, 2020

Updates:

  • r26698 adds grayscale as a valid encoding option, ie:
xpra attach --encoding=grayscale

(also works from the tray menu)

  • r26699 supports grayscale mode for 'jpeg' and 'webp' via pillow
  • r26700 supports grayscale with video modes (via ARGBGrayTo)

@totaam totaam closed this as completed Jun 11, 2020
@totaam
Copy link
Collaborator Author

totaam commented Aug 14, 2020

Fixups in r27138.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant