[NTLUG:Discuss] shrink images globally

Terry Henderson trryhend at gmail.com
Sat Dec 4 13:25:27 CST 2004


On Sat, 4 Dec 2004 11:00:29 -0600, MadHat <madhat at unspecific.com> wrote:
> 
> 
> 
> On Dec 3, 2004, at 7:42 PM, Paul Ingendorf wrote:
> > Easy way to do this is using Image Magik.  You can create a list of
> > files or
> > if you want all the files in a directory to be changed to a specific
> > size
> > use the following
> >
> > for imageFile in *
> > do
> > mogrify -antialias -scale 512x348 $imageFile
> > done
> 
> 
> Don't need to do it that way..
> 
> http://www.imagemagick.org/www/mogrify.html
> 
> "To convert a directory full of JPEG images to thumbnails, use:
> 
>      mogrify -size 120x120 -resize 120x120 +profile "*" *.jpg
> 
>         In this example, '-size 120x120' gives a hint to the JPEG decoder that
> the images are going to be downscaled to 120x120, allowing it to run
> faster by avoiding returning full-resolution images to ImageMagick for
> the subsequent resizing operation. The '-resize 120x120' specifies the
> desired dimensions of the output images. It will be scaled so its
> largest dimension is 120 pixels. The '+profile "*"' removes any ICM,
> EXIF, IPTC, or other profiles that might be present in the input and
> aren't needed in the thumbnails."
> 
> 
> 
> >
> > I use mogrify because it allows a lot more manipulation than just
> > scaling
> > and image format manipulation.  You could just as easily substitute
> > convert
> > while retaining the flags.  Also the image you are working on will be
> > modified and the old info in that file will be lost so use with care.

Thank you. That's the information I was missing, what I just couldn't
get from the manfiles.
mogrify -size 600x600 -resize 600x600 +profile '*' *.jpg; mogrify
-format jpg *.mgk; rm *.mgk
will shrink a whole directory full of large images to smaller ones.  

One could take a quick look, make a few minor croppings, and then
resize the whole batch so that they're all same size with one global
command, or, well 3 commands rolled into one.  And maybe someone see's
an ever easier or shorter version that the one I just came up with and
if so, please share it with me, (shorter / simpler is usually always
better).

But at any rate, that's what I was looking for, just the proper syntax
was all I needed.  I think the manfiles for convert and ImageMagick
and mogrify just need a little more detail and I'd have been able to
figure it out for myself.

 I know these manfiles are already longer than the average person is
willing to read, but they _need_ detail, and people _need_  to be
patient enough to read the whole thing, but even when we do, we
sometimes have to read between the lines in order to glean needed
information, and I'm just not all that good at reading between the
lines.
(Maybe, what we need is just a separate manfile for each option. Or,
_maybe_ just one more option.)  Actually, the information was already
there and I just couldn't quite put it together... anyway, I'm
rambling on here but thanks again.



More information about the Discuss mailing list