Automatically Generated Wallpapers
3 Attachment(s)
This is the thread in which you may publish your scripts generating wallpapers together with the sample results. It is for fun so have fun!
***
I wrote three versions of the script which generates six random wallpapers: three bright (gaussian, impulse, and laplacian), two halftone (multiplicative and poisson), and one dark (random). Each script is parametrized so you may experiment with the parameters values reaching different results. By default each script generates 1024×768 wallpapers. Below are the scripts and the samples taken from the generated wallpapers.
AGW-1-1
Attachment 14047
Code:
#!/bin/bash
# AGW-1-1: creates six random wallpapers (it scales the image after drawing the lines)
# (C) w1k0 from LinuxQuestions.org (2013)
#
# CONFIGURATION SECTION BEGINS HERE
#
width=256 # both these parameters are multiplied by the scale
height=192 # (see: below)
square=8 # the size of the square (use: 4, 8, 16, 32, or 64)
color="lightgray" # the color of the lines (use: white, lightgray, darkgray, gray, or black)
scale=4 # the scale of the wallpaper (use: 1 for 100% scale)
#
# CONFIGURATION SECTION ENDS HERE
#
width_steps=$(($width/$square))
height_steps=$(($height/$square))
drawstr=""
for w in $(seq 0 $width_steps)
do
W=$(($w*$square))
drawstr="$drawstr M $W,0 L $W,$height"
done
for h in $(seq 0 $height_steps)
do
H=$(($h*$square))
drawstr="$drawstr M 0,$H L $width,$H"
done
scale=$(($scale*100))
for method in Gaussian Impulse Laplacian Multiplicative Poisson Random
do
command="convert -size ${width}x${height} xc: -channel G +noise $method -separate +channel \
-stroke $color -strokewidth 1 -draw \"stroke-opacity 1 path '$drawstr'\" \
-scale ${scale}% AGW-1-1-$method.png"
echo $command
echo
eval $command
done
AGW-1-2
Attachment 14048
Code:
#!/bin/bash
# AGW-1-2: creates six random wallpapers (it scales the image before drawing the lines)
# (C) w1k0 from LinuxQuestions.org (2013)
#
# CONFIGURATION SECTION BEGINS HERE
#
width=256 # both these parameters are multiplied by the scale
height=192 # (see: below)
scale=4 # the scale of the wallpaper (use: 1 for 100% scale)
square=4 # the size of the square (use: 4, 8, 16, 32, 64, 128, or 256)
color="lightgray" # the color of the lines (use: white, lightgray, darkgray, gray, or black)
#
# CONFIGURATION SECTION ENDS HERE
#
width_steps=$(($width*$scale/$square))
height_steps=$(($height*$scale/$square))
total_width=$(($width*$scale))
total_height=$(($height*$scale))
drawstr=""
for w in $(seq 0 $width_steps)
do
W=$(($w*$square))
drawstr="$drawstr M $W,0 L $W,$total_height"
done
for h in $(seq 0 $height_steps)
do
H=$(($h*square))
drawstr="$drawstr M 0,$H L $total_width,$H"
done
scale=$(($scale*100))
for method in Gaussian Impulse Laplacian Multiplicative Poisson Random
do
command="convert -size ${width}x${height} xc: -channel G +noise $method -separate +channel \
-scale ${scale}% -stroke $color -strokewidth 1 -draw \"stroke-opacity 1 path '$drawstr'\" \
AGW-1-2-$method.png"
echo $command
echo
eval $command
done
AGW-1-3
Attachment 14049
Code:
#!/bin/bash
# AGW-1-3: creates six random wallpapers (it scales the image twice)
# (C) w1k0 from LinuxQuestions.org (2013)
#
# CONFIGURATION SECTION BEGINS HERE
#
width=64 # both these parameters are multiplied by the scale two times
height=48 # (see: below)
initial_scale=8 # the scale of the wallpaper before drawing lines (use: 1 for 100% scale)
square=8 # the size of the square (use: 4, 8, 16, 32, or 64)
color="lightgray" # the color of the lines (use: white, lightgray, darkgray, gray, or black)
final_scale=2 # the scale of the wallpaper after drawing lines (use: 1 for 100% scale)
#
# CONFIGURATION SECTION ENDS HERE
#
width_steps=$(($width*$initial_scale*$final_scale/$square))
height_steps=$(($height*$initial_scale*$final_scale/$square))
total_width=$(($width*$initial_scale*$final_scale))
total_height=$(($height*$initial_scale*$final_scale))
drawstr=""
for w in $(seq 0 $width_steps)
do
W=$(($w*$square))
drawstr="$drawstr M $W,0 L $W,$total_height"
done
for h in $(seq 0 $height_steps)
do
H=$(($h*square))
drawstr="$drawstr M 0,$H L $total_width,$H"
done
initial_scale=$(($initial_scale*100))
final_scale=$(($final_scale*100))
for method in Gaussian Impulse Laplacian Multiplicative Poisson Random
do
command="convert -size ${width}x${height} xc: -channel G +noise $method -separate +channel \
-scale ${initial_scale}% -stroke $color -strokewidth 1 -draw \"stroke-opacity 1 path '$drawstr'\" \
-scale ${final_scale}% AGW-1-3-$method.png"
echo $command
echo
eval $command
done
|