3 releases (breaking)
0.3.0 | Jan 27, 2021 |
---|---|
0.2.0 | Jan 24, 2021 |
0.1.0 | Jan 22, 2021 |
#771 in Images
11KB
170 lines
discriminord
Create images that appear differently in Discord light and dark themes, or any other application with two different background colors.
Webapp
Installation is no longer necessary! There is a webapp that provides a more interactive experience. If you would still like to use the CLI, follow the instructions below.
CLI Installation
-
You can download and compile it with Cargo:
cargo install discriminord
. -
Prebuilt binaries are also available in the GitHub releases.
CLI Usage
-
Pick two images, one to show to your dark mode friends, and one to show to your light mode enemies.
-
Run
discriminord <dark-image>.png <light-image>.png <output>.png
. -
Share with your friends.
-
Profit!
For more advanced usage, see discriminord --help
.
How it works
The image uses transparency to change the brightness of pixels when the
background color changes. The brightness and transparency of the image pixels
can be thought of as parameters to a linear equation: y = ax + b
. The
background color is passed as the input x
, and the output color (as seen by
the viewer) is the output y
. The alpha channel a
describes how much the
color will vary between the two backgrounds, and the brightness b
is a
baseline / offset.
Dependencies
~16MB
~107K SLoC