[magick-users] Convert options parameter order significance...

Anthony Thyssen anthony at griffith.edu.au
Thu Dec 15 18:33:24 PST 2005


Morten Nielsen on  wrote...
| Hi,
|
| I have been playing around with some php based photo galleries (Gallery
| 1.51 and yappa-ng) and they both use image-magick.
|
| Now my question relates to the different ways these use the "convert" tool.
|
| Gallery uses the following syntax:
| '/opt/bin/convert' '/volume1/web/gallery/albums/Test-Album/test.jpg'
| -quality 100 -size 150x150 -strip -coalesce -geometry 150x150
| '/volume1/web/gallery/albums/Test-Album/test.thumb.jpg'
|
| yappa-ng uses the following syntax:
| '/opt/bin/convert' -quality 100 -size 150x150 -strip -coalesce -geometry
| 150x150 '/volume1/web/gallery/albums/Test-Album/test.jpg'
| '/volume1/web/gallery/albums/Test-Album/test.thumb.jpg'
|
| Could somebody kindly explain the difference to me - there surely must
| be a big one since the Gallery syntax takes ~1 minute and the yappa-ng
| syntax takes just ~5 seconds!
|
first instead of -geomerty   use -resize

Second it is faster as you set a -size before reading a JPEG image

The -size setting for jpeg reading tells IM to limit the read to a
smaller image just larger than the size given.  That is the image in
memory is smaller, and the processing time is thus greatly smaller.

The order should be...

   convert -size 150x150 test.jpg \
           -strip -coalesce -resize 150x150 \
           -quality 100 test.thumb.jpg

the first line is the read operation (with a smaller image read in)
the middle line does all the work on the image in memory
and the last is the save operations.

You can improve thing by replacing the -strip and -resize with
-thumbnail that does both.

Do things in order with their appropriate settings and things will work
as expected.


  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 -----------------------------------------------------------------------------
	Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit
	operating system written for a 4 bit processor by a 2 bit
	company which can not stand 1 bit of competition.
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/


More information about the Magick-users mailing list