Last active
January 19, 2022 15:56
-
-
Save jamesacklin/d4c1ed4a4261cf2e7fa35eeb697b8294 to your computer and use it in GitHub Desktop.
Make a desktop-sized image from any picture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source=$1 | |
dest=${source::-4}_wp.jpg | |
colors=($(convert $source +dither -colors 2 -define histogram:unique-colors=true -format "%c" histogram:info: | awk '//{print $3}')) | |
convert $source \ | |
-gravity center \ | |
-resize 1280x1280 \ | |
-bordercolor ${colors[1]} \ | |
-border 10 \ | |
-bordercolor ${colors[0]} \ | |
-border 33% \ | |
-background ${colors[0]} \ | |
-gravity east \ | |
-extent 3840x2160 \ | |
+repage \ | |
$dest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment