Blur i3lock screen with ImageMagick

I can save a screenshot like this:

import -window root test.png

And I can display that image as the image for i3lock (as per the manpage):

bindsym $mod+u exec convert ~/test.png RGB:- | i3lock --raw 1920x1080:rgb --image /dev/stdin

This looks as expected. However, when I try to combine the two like this:

bindsym $mod+u exec import -window root RGB:- | i3lock --raw 1920x1080:rgb --image /dev/stdin

the image looks off. It looks like the image is just the left top half of the screen blended over with the right top half of the screen. It seems the font doubled in size.

Why doesn’t this work the way I expected? How to correctly pipe the image from import to i3lock? Piping from convert seems to be working just fine.

(Both import and convert belong to ImageMagick.)

Adding -depth 8 solves the issue. The problem is that an image imported from the screen has a depth of 16.

This is what the command should look like:

bindsym $mod+u exec import -window root -depth 8 RGB:- | i3lock --raw 1920x1080:rgb --image /dev/stdin
1 Like