Skip to content

Commit

Permalink
make logo effects more scalable + add more options
Browse files Browse the repository at this point in the history
  • Loading branch information
bob8677 committed Apr 11, 2021
1 parent 4a4137e commit 0ac0b0f
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions wallutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,17 @@ compwallpaper() {
instantoverlay
imgresize overlay.png "$RESOLUTION"

# perpare effects
case $(iconf logoeffects) in
"invert")
convert wall.png -channel RGB -negate effect.png
;;
"blur")
convert wall.png -blur 100x100 effect.png
;;
"both")
convert wall.png -blur 100x100 -channel RGB -negate effect.png
;;
esac
# perpare effect settings
iconf logoeffects | grep swirl && EFFECTS+=("-swirl" "360")
iconf logoeffects | grep flip && EFFECTS+=("-flip")
iconf logoeffects | grep blur && EFFECTS+=("-blur" "100x100")
iconf logoeffects | grep invert && EFFECTS+=("-channel" "RGB" "-negate")
iconf logoeffects | grep grayscale && EFFECTS+=("-colorspace" "Gray")
iconf logoeffects | grep contrast && EFFECTS+=("-level" "20000")
iconf logoeffects | grep dim && EFFECTS+=("-modulate" "50")
iconf logoeffects | grep brighten | grep -v dim && EFFECTS+=("-modulate" "150")

convert wall.png "${EFFECTS[@]}" effect.png

# create mask from overlay
convert overlay.png -alpha extract mask.png
Expand All @@ -165,7 +164,6 @@ compwallpaper() {
rm wall.png
rm mask.png
rm cut.png
rm blackandwhite.png
rm effect.png
else
echo "logo disabled"
Expand Down

0 comments on commit 0ac0b0f

Please sign in to comment.