ii/image


exemples

exemples

# Titre Desc
1Framelapse Reims 14è
2Ciel de Reims du 7 mai 2021

vrac

scan_en_1_click

Fichier $USER/bin/scan_en_1_click.sh

Scan en 1 clic d'une feuille A4



# scan 1 clic sur DOT S avec Canon scanner à plat - Linux Mint
scangearmp2 &
sleep 3

# première boite scanner
echo xdotool mousemove 574 331
xdotool mousemove 574 331
sleep 1
echo 'xdotool mousedown 1; xdotool mouseup 1'
xdotool mousedown 1; xdotool mouseup 1
sleep 2

# bouton numériser (JPEG)
echo xdotool mousemove 522 400
xdotool mousemove 522 400
sleep 1
echo 'xdotool mousedown 1; xdotool mouseup 1'
xdotool mousedown 1; xdotool mouseup 1
sleep 2

# nom fichier
xdotool mousemove 651 203
sleep 1
xdotool mousedown 1; xdotool mouseup 1
sleep 2
# effacer nom
for i in $(seq 1 1 20); do xdotool key BackSpace; done
xdotool type scan_auto$(date +%H_%M_%S)
sleep 1
# lancer skan
xdotool mousemove 708, 390; sleep 1; xdotool mousedown 1; xdotool mouseup 1

annoter_images_taille_dyn

# annoter_images_taille_dyn.sh

# annoter des images en fonction de la taille de chaque image

# https://stackoverflow.com/questions/58621445/imagemagick-how-to-create-an-annotation-that-would-fit-its-size-into-any-image?newreg=53997a2d9b724f1fb5c70113ea3c1332

# ==========================================================
# Using ImageMagick version 6 or 7 you can make a label sized to fit any input image, with a semi-transparent background, and composite it at the bottom of the input image to get the result you describe. Here is a command with IM 6 that does it...
# 
# convert input.png -set option:size %[w]x \
#    -fill white -background "#00000080" \
#    \( label:"This is my text." \
#       -virtual-pixel background -distort SRT "0.8 0" \
#       -virtual-pixel none -distort SRT "0.8 0" \) \
#    -gravity south -composite result.png
# That uses the width of the input image "%[w]" to set the width of the label. It sets the text color to white and the background to semi-transparent black, "#00000080".
# 
# Inside the parentheses it creates your label. It uses "distort SRT" to scale the label down a bit to pull it in from the edges. Then it scales the label down a bit more to add some transparent space around it.
# 
# After the label is created it sets the gravity to "south" and composites the label onto the input image. It finishes by writing the output file.
# 
# Using IM 7 you'll need to change "convert" to "magick". For Windows change the continued line backslashes "\" to carets "^" and get rid of the backslashes that escape the parentheses.
# 
# Edited to add: Normally you'd use "-size WxH" ahead of making a "label:" to constrain it within particular dimensions. I used "-set option:size" instead because it allows for using percent escapes like "%[w]" with IM 6. That way the label dimensions are relative to any input image width.
# ==========================================================

ls -1 *jpg | sort > /tmp/liste_jpg.txt
n=10000
workdir=/tmp/annoter_images_taille_dyn
mkdir $workdir

# 1. copier les images
echo $(date) 1. copie jpg
while read jpg; do
    cp $jpg $workdir
    n=$((n+1))
done < /tmp/liste_jpg.txt

# 2. annoter les images
echo $(date) 2. annotation
cd $workdir
 
ls -1 *.jpg | xargs -i convert {} -set option:size %[w]x \
   -fill white -background "#00000080" \
   \( label:"{}" \
      -virtual-pixel background -distort SRT "0.8 0" \
      -virtual-pixel none -distort SRT "0.8 0" \) \
   -gravity south -composite {}

# 3. résultat
echo $(date) 3. fichiers créés dans $workdir 
   
        

annoter_images_video

# images2video.sh

# source : http://gangand.net/ff/formation/notes/system_partie_1.html

# création d'une vidéo serie_HH_MM_SS.avi
# depuis les images du dossier courant

# utile suite à la capture d'images par motion
# sur Raspberry Pi (oiseaux venant boire)
ls -1 *jpg | sort > /tmp/liste_jpg.txt
n=10000
mkdir /tmp/video_ffmpeg

# 1. copier les images
echo $(date) 1. copie jpg
while read jpg; do
    cp $jpg /tmp/video_ffmpeg/serie-$n.jpg
    n=$((n+1))
done < /tmp/liste_jpg.txt

# 2. annoter les images
echo $(date) 2. annotation
cd /tmp/video_ffmpeg
ls -1 *.jpg | xargs -i convert {} -fill white \
 -undercolor '#00000080' \
 -gravity South \
 -annotate +0+5 {} {}

# 3. créer une vidéo
echo $(date) 3. ffmpeg
ffmpeg -f image2 -i serie-1%04d.jpg -r 12 serie.avi

# 4. nettoyer
echo $(date) 4. nettoyage
mv serie.avi serie_$(date '+%Hh%Mmn%S').avi
#~ rm /tmp/liste_jpg.txt
#~ rm -rf video_ffmpeg

# 5. annoncer résultat
echo $(date) 5. fichier .avi créé dans $(pwd)