linux - Batch mode images on white background of A5 size -


i have 260 scanned images of text ‘tailored’ scantailor cropped contain text area (no margins on side). bit smaller size of a5 (the hard copy a5).

now, want put of them (individually) on white background of a5 size, horizontally centred, vertically image should start 0.88 inches top of background. should done in terminal in batch mode. imagemagick should job, cannot imagine how.

info: ubuntu gnome 13.10 i386

update #1

convert bg.tif fg.tif -gravity center -composite new.tif

this command partially suficient, centres fg.tif horizontally and vertically. have no idea how put fg.tif 0.88 inches top while horizontally centred.

btw, images 300 dpi. in update #1, bg.tif image created in gimp of a5 size , has white background , processed same settings in scantailor same image qualities other files.

undate #2

i have manually found out the following command puts fg image approx .88 inches top:

composite -geometry +0+264 fg.tif blnk_300.tif new.tif

but combine -gravity center not simple, next command first centres (horiz and vert) , adds +0+264:

composite -gravity center -geometry +0+264 130b.tif blnk_300.tif new.tif

so output doubled top (that +0+528) while horizontally still centred.

the first step have not been yet able accomplish terminal, opened gimp,

  1. created new image (ctrl+n),
  2. template: a5 (300 ppi)
  3. after clicking on advanced options, fill with: white
  4. click on ok (or press enter)

then exported (ctrl+e) bg.tif (when asked, select no compression , export/enter). had 13 mb, decided scantailor (the way other scanned images have same qualities).

and finally, command:

composite -gravity center -gravity north -geometry +0+264 130b.tif blnk_300.tif new.tif

i tried use multiple -gravity settings , worked!


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -