Posted: . At: 9:20 AM. This was 3 years ago. Post ID: 14768
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


How to generate a very nice colored desktop background with the command line.


The Linux command line is very useful and it can even generate you a nice wallpaper image using just the shell and ImageMagick. The example below will generate a 3440×1440 pixels wallpaper image using just the random data from /dev/urandom.

┌─[jason@jason-desktop][~/Documents]
└──╼ $mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | convert -depth 8 -size "${mx}x${my}" -resize 3440x1440\! -channel RGBA -filter Gaussian -blur 0x64 RGB:- random.png

This gives quite a good output. This is an interesting way to generate a random image from the command line.

This example will generate a monochrome image.

┌─[jason@jason-desktop][~/Documents]
└──╼ $mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | convert -depth 8 -colors 256  +dither -size "${mx}x${my}" -resize 3440x1440\! -blur 0x32 -charcoal 7 -channel RGBA RGB:- random.png

This is also a very colorful and attractive example.

┌─[jason@jason-desktop][~/Documents]
└──╼ $mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | convert -depth 8 -colors 256  +dither -size "${mx}x${my}" -resize 3440x1440\! -blur 0x96 -function ArcTan 3.0,0.5,3.0,0.5 -channel RGBA RGB:- random.png

I have uploaded a couple of images here: https://ibb.co/album/D9k6ht. This will give you an idea of what this will output. Just play around with the values until you get the type of image you are after.

And finally, this will create a very interesting effect for a Linux wallpaper.

┌─[jason@jason-desktop][~/Documents]
└──╼ $mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | convert -depth 8 -colors 256  +dither -size "${mx}x${my}" -resize 3440x1440\! -blur 0x64 -implode 32 -channel RGBA RGB:- random.png

Give these a try, this is a very interesting way to generate a Linux wallpaper image.

The example below is the best yet. This takes a long time to render, but it generates a Gnome Shell styled wallpaper.

┌─[jason@jason-desktop][~/Documents]
└──╼ $mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | convert -depth 8 -colors 256 -size "${mx}x${my}" -resize 1920x1080\! -motion-blur 0x512+45 -channel RGBA RGB:- random.png

A very nice result indeed.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.