Notas de Luis

¡Esta es una revisión vieja del documento!


Image - Fu

Redimensionar

convert -scale 600x foto.jpg foto-nueva.jpg
convert -scale 600x misma.jpg misma.jpg

Ajustar el contraste

convert --contrast foto.jpg foto-nueva.jpg

Marca de agua

convert -background white  -fill blue -font CosmosBQ-Medium -pointsize 30 \
    label:' Luis Arocha '  label.gif
composite -gravity southwest -dissolve 40% label.gif   FILEIN FILEOUT
composite -dissolve 30% -tile watermark.png input.png output.png

Remove border of image

for i in *.jpg; do convert  $i -crop 1920x1080-0+60  xx-$i.jpg; done
convert input.png -shave 10x10 output.png
for i in 0*.jpg; do echo $i; convert $i -gravity center -crop 3840x1080+0+0 +repage $i;done

Cambiar la hora de las fotos. sumar una hora

# jhead -ta+01:00 *
# jhead -ta+1 *
 
exiftool -overwrite_original "-AllDates+=0:0:0 1:0:0" 000*.jpg

to adjust all JPG image dates

By adding 1 year, 12 month, 28 days, 14 hours, 54 minutes, 32 seconds

exiftool "-AllDates+=1:12:28 14:54:32" -verbose *.jpg

Batch resize

All images to a width of ‘X’ pixels while maintaing the aspect ratio

mogrify -resize SIZE_IN_PIXELS *.jpg
for i in *.jpg; do echo $i; convert -geometry 3840x $i $i;done
for a in `ls`; do echo $a && convert $a -resize WIDTHxHEIGHT $a; done

Converts all jpg files to 75 quality.

find . -type f -name '*.jpg' -exec convert -quality 75 {} {} \;

Copy all Photos from Canon A520 to one place

find / -type f -name IMG_????.JPG -print0 |xargs -0 exiv2 -g Exif.Canon.ModelID '{}' |grep A520 |rev |cut --complement -d " " -f1-40 |rev |xargs -I {} cp --parents {} /where

Find corrupted jpeg image files

find . -iname '*jpg' -print0  | xargs -0 exiftool -warning; find . -iname '*jpg' -print0  | xargs -0 jpeginfo -c
find . -name "*jpg" -exec jpeginfo -c {} \; | grep -E "WARNING|ERROR"

Generate a Google maps URL for GPS location data from digital photo

echo "https://www.google.com/maps/place/$(exiftool  -ee -p '$gpslatitude, $gpslongitude' -c "%d?%d'%.2f"\" image.jpg 2> /dev/null | sed -e "s/ //g")"

Remove *.jpg smaller than 500x500

identify -format '%w %h %f\n' *.jpg | awk 'NF==3&&$1<500&&$2<500{print $3}' | xargs -r rm

Rotate images matching their EXIF data.

jhead -autorot *.jpg

Aclarar imagenes

Ideal para documentos escaneados

convert xxxx.jpg -colorspace Gray -level 40%,60% clean-xxxx.jpg

Reescalar carnets a tamaño fijo y recuperar la proporcion adecuada a dni u otros carnets

for img in *.jpg; do convert $img -auto-orient -resize 1586x1000\! fixed-$img;done
computing/multimedia/image-fu.1773238729.txt.gz · Última modificación: por alfabeto