imágenes mágicas | imagemagick
| Author: | Osiris Alejandro Gomez <osiux@osiux.com.ar> |
|---|---|
| license: | CC-BY-SA |
| Date: | 2010-05-10 19:45 |
Contents
Descripción breve
Resolución a problemas comunes en la manipulación de imágenes mediante la generación de scripts usando ImageMagick y otras utilidades. Creación y edición de imágenes sin usar un editor gráfico, directamente desde una consola. Generar un video a partir de fotografías.
Crear Imagen
convert -size 100x50 xc:black black.png
identify
identify black.png black.png PNG 100x50 100x50+0+0 8-bit PseudoClass 2c 226b 0.000u 0:00.000
Creative Commons
cc.sh #!/bin/bash convert font-fotos-00.jpg -fill white \ -font /usr/share/fonts/truetype/cc-icons.ttf \ -pointsize 32 -gravity SouthEast \ -annotate 0 'cb' \ cc-fotos-00.jpg
dark
dark.sh #!/bin/bash composite -compose colorburn gradient.png \ fotos-00.jpg dark--fotos-00.jpg
font
font.sh #!/bin/bash convert mini-monte-hermoso-2010-3.jpg -fill white \ -font /usr/share/fonts/truetype/ttf-lucida/LucidaSansRegular.ttf \ -pointsize 32 -gravity NorthWest \ -annotate 0 'monte desastroso 2010' \ font-mini-monte-hermoso-2010-3.jpg
rename
renombrar.sh #!/bin/bash c=0;ls | grep jpg | while read f; \ do mv -v $f $'monte-hermoso-2010-'$c$'.jpg'; \ c=$[$c+1];done
resize
resize.sh #!/bin/bash ls | grep jpg | while read f;do echo $f; \ convert -filter cubic -resize 640 $f $'mini-'$f;done
gray
convert osiux-color.jpg +dither -colors 2 -colorspace gray -contrast-stretch 0 osiux-2-grises.jpg convert osiux-color.jpg +dither -colors 4 -colorspace gray -contrast-stretch 0 osiux-4-grises.jpg convert osiux-color.jpg +dither -colors 8 -colorspace gray -contrast-stretch 0 osiux-8-grises.jpg convert +append osiux-color.jpg osiux-2-grises.jpg osiux-4-grises.jpg osiux-8-grises.jpg
edge
for i in {1..4};do convert osiux-color.jpg -colorspace Gray -edge $i osiux-edge-$i.jpg;done convert +append osiux-edge-1.jpg osiux-edge-2.jpg osiux-edge-3.jpg osiux-edge-4.jpg osiux-edge.jpg
edge + Negate
for i in {1..4};do convert osiux-color.jpg -colorspace Gray -edge $i -negate osiux-edge-$i-negate.jpg;done convert +append osiux-edge-1-negate.jpg osiux-edge-2-negate.jpg osiux-edge-3-negate.jpg osiux-edge-4-negate.jpg osiux-edge-negate.jpg
edge + negate + blur
for i in {1..4};do convert osiux-edge-$i-negate.jpg -blur 0x1 osiux-edge-$i-negate-blur.jpg;done convert +append osiux-edge-1-negate-blur.jpg osiux-edge-2-negate-blur.jpg osiux-edge-3-negate-blur.jpg osiux-edge-4-negate-blur.jpg osiux-edge-negate-blur.jpg
charcoal (edge + negate + blur)
for i in {1..4};do convert osiux-color.jpg -charcoal $i osiux-charcoal-$i.jpg;done convert +append osiux-charcoal-1.jpg osiux-charcoal-2.jpg osiux-charcoal-3.jpg osiux-charcoal-4.jpg osiux-charcoal.jpg
append
convert -append osiux-edge.jpg osiux-edge-negate.jpg osiux-edge-negate-blur.jpg osiux-charcoal.jpg
