AVIF image support for Colorizer

This commit is contained in:
Daniel Napora 2024-01-28 11:39:35 +01:00
parent 115fa05497
commit fd759a4cc6

View File

@ -41,9 +41,15 @@ n=${#HOME}
((n++)) ((n++))
NAME=${NAME:${n}} NAME=${NAME:${n}}
fi fi
ext="${WALLPATH##*.}"
#notify-send.sh "Extension" "$ext"
if [ ! -f "$WALLPALDIR/${NAME}.clr" ]; then if [ ! -f "$WALLPALDIR/${NAME}.clr" ]; then
convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr" if [ "$ext" == "avif" ];then
convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,3) substr($3,6,2) substr($3,10,2)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr"
else
convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr"
fi
fi fi
# GENERATE THUMBNAIL # GENERATE THUMBNAIL
@ -60,10 +66,10 @@ convert ${WALLPATH} -resize 52x52^ -gravity center -extent 52x52 -bordercolor wh
killall -SIGUSR1 tint2 killall -SIGUSR1 tint2
# auto generate themes # auto generate themes
if command -v w2theme &> /dev/null #if command -v w2theme &> /dev/null
then #then
source ~/.config/colorizer/colorizer.conf #source ~/.config/colorizer/colorizer.conf
if [[ "$wall2themes" == "yes" ]];then # if [[ "$wall2themes" == "yes" ]];then
w2theme colorize # w2theme colorize
fi # fi
fi #fi