Friday, December 9, 2016

Rename all JPG MP4 files in the current directory to date_time file name format.

Rename all files in the currect directory to date_time file name format


sudo exiftool '-filename<CreateDate' -d %y-%m-%d_%H-%M-%S.%%ue  -r -ext JPG  .

Rename files with MOV extention to MP4 extention.

Rename all files with .MOV extention to .MP4 extention.

sudo rename -v 's/\.MOV$/\.MP4/'  *.MOV

Extracting images from video file

Get image from input.flv file at 14.435 sec and save to out.png file

avconv -i input.flv -ss 00:00:14.435 -f image2 -vframes 1 out.png
avconv -i input.flv -ss 00:00:14.435 -f image2 -vframes 1 out.png

Adding text annotations to JPG image.

Adding annotation "Copyright" at lower right corner of image at font size 20, filled with white color and black shadow,  saved to file IMG_ANNOTATED.JPG

sudo convert IMG.JPG  -font Arial -pointsize 20 -draw "gravity SouthEast fill black text 0,12 'Copyright' fill white text 1,11 'Copyright'"  IMG_ANNOTATED.JPG 

Adding GIF image to JPG image with transparent area.

1. Install ImageMagick:
sudo apt-get install imagemagick

2. Using convert command from ImageMagick make white part of Arrow.gif transparent and save in file arrow_transparent.gif :
sudo convert Arrow.gif -fuzz 10% -transparent white arrow_transparent.gif 

3. Merge arrow transparent into IMG.JPG at affset 300,300 and save file in RESULT.JPG file:
sudo convert IMG.JPG -page +300+300 arrow_transparent.gif -flatten RESULT.JPG

Followers

About Me