[wellylug] Automation with Image Magick
Leslie Boardman
elbe at araitanga.com
Wed Feb 4 22:15:36 NZDT 2004
Cool, thanks for all the tips. I hadn't heard of the python image lab
thing before so I'll have a look at it this weekend.
Actually I am also going to look for away to rename all the images I get
off the camera automatically (I am sooo lazy!) using the date and the
script below looks like a good starting point for that.
I'll post back if I hit another wall or taste sweet success.
Leslie
On Wed, 2004-02-04 at 11:26, Wood Brent wrote:
>
> --- Martin Wehipeihana <martin at actionit.co.nz> wrote:
> > >>I am trying to get Image Magick to 'stamp' images
> > >>with a line of text.
> > >>Essentially shadowing the lettering through the
> > >>image. I want to be
> > >>able to 'stamp' the file name of the image on the
> > >>image.
> >
> > Have you tried python and PIL (python image lab) ?
> >
>
>
> Done this pretty simply for a webcam.
>
> A shell script can process a list of files, break up the file names to extract
> the componenets of the date/time, reassemble them into the desired string(s) to
> overlay on the image, then use the ImageMagick mogrify command to writet teh
> text to the image, wherever you want on the image. (I actually used convert
> rather than mogrify to create a new file, with a new name, without affecting
> the original image)
>
> I don't have a copy, but could prob scribble summat out in a few minutes if
> necessary.
>
> Basically it was along the lines of:
>
>
> LIST=`ls *.jpg`
>
> for FILE in $LIST ; do
> #use cut to break up $FILE to get the date/time fields
> # eg: MONTH=`echo $FILE | cut -b5,6`
> # would assign chars 5 & 6 to the variable MONTH
> # etc
>
> #reassemble the bits to make the total string you want to write
> # eg: LABEL=${YEAR}_${MONTH}_${DAY}_${HR}:${MIN}:${SEC}
>
> # use mogrify or convert to overlay the text on the image
> # with -label or -draw (text)
> done
>
>
> see http://www.cit.gu.edu.au/~anthony/graphics/imagick/annotating/
>
> for a good set of instructions. It even describes how you can dim the box of
> the image the text is to be written to so the text will always be readable
> irrespective of background colour.
>
>
> Cheers,
>
> Brent Wood
>
>
>
> done
>
>
> --
> Wellington Linux Users Group Mailing List: wellylug at lists.naos.co.nz
> To Leave: http://lists.naos.co.nz/mailman/listinfo/wellylug
>
--
Leslie Boardman, E: elbe at araitanga.com, ICQ:153582540
PGP Fingerprint:EDBB E4CD C87F 528F 9998 824E 013A EE94 A27A B6D1
PGP Key Server: http://www.keyserver.net
"ignorance more frequently begets confidence than does knowledge"-Darwin
More information about the wellylug
mailing list