Notas de Luis

¡Esta es una revisión vieja del documento!


# Image - Fu

## Redimensionar

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

## Ajustar el contraste

```bash convert –contrast foto.jpg foto-nueva.jpg ```

## Marca de agua

```bash 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

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

## Cambiar la hora de las fotos. sumar una hora

```bash jhead -ta+01:00 * jhead -ta+1 * ```

## to adjust all JPG image dates

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

```bash 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

```bash 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.

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

## Copy all Photos from Canon A520 to one place

```bash 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

```bash 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

```bash 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 500×500

```bash 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.

```bash jhead -autorot *.jpg ```

## Aclarar imagenes

Ideal para documentos escaneados

```bash 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

```bash for img in *.jpg; do convert $img -auto-orient -resize 1586×1000\! fixed-$img;done ```

computing/multimedia/image-fu.1763983076.txt.gz · Última modificación: por alfabeto