Skip to content

Instantly share code, notes, and snippets.

@kadamwhite
Created September 11, 2020 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kadamwhite/c78a90d8b0ae4388c3a679bc3e8f733a to your computer and use it in GitHub Desktop.
Save kadamwhite/c78a90d8b0ae4388c3a679bc3e8f733a to your computer and use it in GitHub Desktop.
A shell script to add "Kurosawa mode" (as implemented in the videogame Ghost of Tsushima) to your webcam, tested with a Logitech c920 on Ubuntu. Run "bash kurosawa.sh on" or make it an executable and run `kurosawa on` to activate high-contrast black-and-white; run with "off" to disable/reset.
#!/usr/bin/env bash
MODE="$1"
if [ $MODE = "on" ]; then
v4l2-ctl -d /dev/video0 --set-ctrl=saturation=0,contrast=190,brightness=105
elif [ $MODE = "off" ]; then
v4l2-ctl -d /dev/video0 --set-ctrl=saturation=128,contrast=128,brightness=120
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment