Friday, January 27, 2012

Resize & write data into image

I had task to resize image and add unique identifier. See below handful utilities.

- Exiv2 (manage image metadata. Supports IPTC, Efix, XMP and others formats)
Example: Add the field to IPTC
[sputnik@test_hires] iptc -M"add Iptc.Application2.SpecialInstructions blah blah" myfile.jpg

- Imagemagick (resize, edit, view images or more)
Example: Resize image to 200x200 pixels
[sputnik@test_hires] convert -resize 200x200 myfile_input.jpg myfile_output.jpg

- Identify (image characteristics. is a member of the ImageMagick suite of tools)
Example: Get image size
[sputnik@test_hires] identify -format '%w:%h' $source

- File (determine file type)
Example: Get Filename information. For more 'man file'
file -i $filename | cut -d':' -f 2

No comments:

Post a Comment