Re: [GM-help] Order of operations, and -size question
Swiss army knife of image processing
Brought to you by:
bfriesen
From: john a. <jal...@ya...> - 2009-05-23 00:48:28
|
Hrm. Ok. So since in this case, I've got two conversions. They are operating on the exact same original, with all of the same options, and are ultimately doing a -resize. If I stick an additional '-size' option at the beginning, the file comes out: - the same, visually (as best as my eyes are, anyway), - same resolution - slightly bigger filesize (about 9% bigger) - >2x faster to process (!) Check it out: $ time /opt/local/bin/gm convert -limit Memory 512M -limit Map 2048M -limit Disk 2048M -flatten ./3171145347_d490413003_o.jpg -sharpen 1.00x0.95 -resize 1024x1365! -interlace None -type TrueColor -quality 96 -sampling-factor 1x1 ./3171145347_d490413003_l.jpg ; ls -l ./3171145347_d490413003_l.jpg /opt/local/bin/gm convert: Image sequence is required (unable to flatten image). real 0m3.013s user 0m2.817s sys 0m0.130s -rw-r--r-- 1 user user 1121101 May 22 17:31 ./3171145347_d490413003_l.jpg $ time /opt/local/bin/gm convert -size 1024x1365 -limit Memory 512M -limit Map 2048M -limit Disk 2048M -flatten ./3171145347_d490413003_o.jpg -sharpen 1.00x0.95 -resize 1024x1365! -interlace None -type TrueColor -quality 96 -sampling-factor 1x1 ./3171145347_d490413003_l2.jpg ; ls -l ./3171145347_d490413003_l2.jpg /opt/local/bin/gm convert: Image sequence is required (unable to flatten image). real 0m1.266s user 0m1.147s sys 0m0.066s -rw-r--r-- 1 user user 1199339 May 22 17:31 ./3171145347_d490413003_l2.jpg GM 1.3.5, compiled with the libjpeg with SIMD extensions (the japanese one). What does it mean to have -size and -resize on the same line. I'm puzzled. Not complaining about it, but puzzled. If I can take the hit on the filesize, wondering if we shouldn't do this for the performance bump. :) -j ----- Original Message ---- > From: Bob Friesenhahn <bfr...@si...> > To: john allspaw <jal...@ya...> > Cc: Requests for help with GraphicsMagick <gra...@li...> > Sent: Wednesday, May 20, 2009 3:42:35 PM > Subject: Re: [GM-help] Order of operations, and -size question > > On Wed, 20 May 2009, john allspaw wrote: > > > > 1 - what does adding the "-size" parameter do to the conversion line? > > Provided that -size is specified before the name of a JPEG file to > read, it instructs libjpeg to return a subresolution at least as large > as the specified size, but as small as possible. This is done at the > JPEG DCT level so it is extremely efficient. When the objective is to > produce much smaller versions of the JPEG image (e.g. thumbnails) this > is the best way to improve performance. > > > 2 - as far as the various options are concerned, does it matter > > which order they're in? (sharpen,sampling-factor,interlace, etc.) > > Yes, it does matter. Options like sampling-factor and interlace are > used when saving a file, so they need to be specified prior to the > file to save. Commands like -sharpen modify the image so they > should come after the filename to read and before the filename to > write. > > I know that it is confusing. Even more confusing is that in order to > support Unix conventions, GM also supports specifying options first. > I recommend always specifying options/commands in left to right order > and not relying on the automatic reordering feature. > > Bob > -- > Bob Friesenhahn > bfr...@si..., http://www.simplesystems.org/users/bfriesen/ > GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://www.creativitycat.com > _______________________________________________ > Graphicsmagick-help mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help |