Discussion:
Uniform size of a set of images
Seb35
2010-05-08 12:39:02 UTC
Permalink
Hello,

I have to trim big blank edges of pages of a scanned book (many many books
in fact). The -trim option gives excellent results but it is possible to
specify another option to make all pages have the same size? Something
like -size but with the largest size of the set of images.

Thank you,
Sébastien
Fred Weinhaus
2010-05-08 14:43:45 UTC
Permalink
Post by Seb35
Hello,
I have to trim big blank edges of pages of a scanned book (many many books
in fact). The -trim option gives excellent results but it is possible to
specify another option to make all pages have the same size? Something
like -size but with the largest size of the set of images.
Thank you,
Sébastien
You will need to write a script to trim them all,
find their sizes, find the max size, then use
-extent to pad them all to the same size.
Anthony Thyssen
2010-05-09 09:43:08 UTC
Permalink
On Sat, 8 May 2010 07:43:45 -0700
magick-users-***@imagemagick.org wrote:

| >Hello,
| >
| >I have to trim big blank edges of pages of a scanned book (many many books
| >in fact). The -trim option gives excellent results but it is possible to
| >specify another option to make all pages have the same size? Something
| >like -size but with the largest size of the set of images.
| >
| >Thank you,
| >Sébastien
|
|
| You will need to write a script to trim them all,
| find their sizes, find the max size, then use
| -extent to pad them all to the same size.

Adjectivally if you can merge the pages together into one
page, then trim, you can then use the resulting virtual canvas
to do a 'Multiple Image Composition' (which understands virtual offsets)
to trim all the pages in the same way as the combined page.

See IM examples, Animation Modifications
Layers Composition - alpha composition for image lists
http://www.imagemagick.org/Usage/anim_mods/#composite

Yes this is a odd place in IM examples, but it was developed with
a list of multiple images (such as you get with animations) in mind.
I should know, I developed and programmed it.

You would use the 'combined' image as a single 'destination image'
and then overlay all the other images onto that destination to
automatically 'trim them the same as the 'destination image'.

This is also the only case where image meta-data from the 'source'
images (like comments, lables, etc) is preserved in the resulting
list.


Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
I smell a Wumpus! -- One of the first computer games.
--------------------------------------------------------------------------
Anthony's Castle http://www.cit.griffith.edu.au/~anthony/

Loading...