A small and fast rust tool which can blur
images with cool features like:
As you can see the default behaviour is to scale down
the image by 25%
,
for the scale down the Gaussian filter
will be applied.
After it was scaled down, it's scaling up
with the nearest filter
.
That behaviour make the text unreadable but the image itself crispy af! <3 \
And don't worry, you can change the scale down and up filter! :)
When I lock my computer or laptop, I love it to take a screenshot of the current state, blur the image and set the blured image as lock screen. So that's it, just a small tool which blurs images. :)
If you are using i3, you can install the cliblur
and create a small bash script
to create a screenshot, blur it and lock your screen. :)
```bash
cd "$(dirname "$0")"
IMAGE=/tmp/lock.png
scrot -q 100 $IMAGE cliblur $IMAGE i3lock -i $IMAGE rm $IMAGE ```
Because convert is very slow ... I mean really slow ... I love it take a screenshot, blur it and set it as my locking screen, but convert is so damn so. It takes 2 seconds on 16 cores (and yes, all of them are running...). So I created this small tool, it's finishing the blur effect in just ~460ms and takes one thread (instead of 16 threads with 100%). :) \ The next reason is, the blur effect itself, as you can see on the example image, the image is cripsy af, but blurred. That's because I'm scaling down the image with Gaussian and scaling it up with nearest. So it's blurring a crispy image without exposing any text! Hurray! <3
Just install it with crates, that's it! :)
bash
cargo install cliblur
You can also install the compiled version or build it yourself. :)\ See the chapter "Install (advanced)". :3
It's working out of the box with default parameters. You just need to to run the command and specify the file:
bash
cliblur /tmp/lock.png
Keep in mind, if you're just set the input file, the same file will be overwritten! You can avoid that by writing the destination file, as you can see here.
bash
cliblur /tmp/lock.png /tmp/bluredlock.png
You can modify the settings for the blur effect.
There is a scale
which can be changed, so the blur will be increased/decreased.
And by the way, you can also change the scale down and scale up filter.
It's looking kinda 8-bit like if you use the gaussian
filter for scale down
and the nearest
for scaling up
.
If you just wanna blur the image, you can use the gaussian
filter for
scale down
and scale up
.
You can also say where the blur effect should start and end, see the documentation
for -x
, -y
, -width
and -height
for more information.
Just try a little bit around until you find something that's fits.
The documentation can be found in the --help
. :)
```bash $ cliblur --help
cliblur 0.3.1 DaniƩl Kerkmann daniel@kerkmann.dev A faster and more usefule image blur tool.
USAGE:
cliblur [OPTIONS]
ARGS:
OPTIONS: -d, --debug Set logging level to debug
-g, --grayscale
Remove color from image
-h, --height <HEIGHT>
height of the blur effect, otherwise it will blur till the end
--help
Print help information
-l, --license
Print license information
-r, --resize-down-filter <RESIZE_DOWN_FILTER>
Will apply the filter on resize down [default: gaussian] [possible values: catmull-rom,
gaussian, lanczos3, nearest, triangle]
-R, --resize-up-filter <RESIZE_UP_FILTER>
Will apply the filter on resize up [default: nearest] [possible values: catmull-rom,
gaussian, lanczos3, nearest, triangle]
-s, --resize-scale <RESIZE_SCALE>
Set the resize scale ratio from resizing it down and up [default: 25]
-V, --version
Print version information
-w, --width <WIDTH>
width of the blur effect, otherwise it will blur till the end
-x, --x <X>
x coordinate where the blur should start [default: 0]
-y, --y <Y>
y coordinate where the blur should start [default: 0]
```
It's really easy! For real, trust me. :3
```bash
curl -L https://gitlab.com/kerkmann/cliblur/-/jobs/artifacts/main/raw/cliblur\?job\=release --output cliblur
chmod +x cliblur
/usr/local/bin/cliblur
sudo cp cliblur /usr/local/bin/cliblur ```
You are not trusting the pre built binary? Thankfully, you can build it yourself! :3
```bash
git clone https://gitlab.com/kerkmann/cliblur
cd cliblur
cargo build --release
upx --best --lzma target/release/cliblur
chmod +x target/release/cliblur
/usr/local/bin/cliblur
sudo cp target/release/cliblur /usr/local/bin/cliblur ```