List Info

Thread: Re: converting tiff to jpeg (incl. resizing)




Re: converting tiff to jpeg (incl. resizing)
country flaguser name
Canada
2007-08-01 13:17:34
Hello Jan Pieper.

If you are talking about batch conversion (many images at
once), you have two options that I am aware of:

1) Write a small GIMP program using "Script-Fu"
(or Perl, Python, PHP, etc.) from the Xtns menu.  This will
take a bit of learning if you haven't done a script before,
but it is certainly doable.  There are many guides available
on the web with introductory examples of how to do the
things you want (scale, save as, close) an image.

2) Use the command line utility "convert" from the
ImageMagick program suite.  It is available for most
operating systems.  It is very easy to script convert using
a DOS/Windows batch/cmd script, or a Unix shell script.

e.g. a GNU Bash script:

#!/bin/bash

for image in *.tiff; do

   convert "$image" -resize 800x600 -quality 90
"$(basename "$image"
".tiff").jpg"

done

For a Windows batch script you would need to use a similar
for loop, though there is no equivalent to the
"basename" command, so you will end up with
filenames such as "foo.tiff.jpg".

G'day,

 - raven morris






------------------------------------------------------------
---------
To unsubscribe, e-mail: gug-unsubscribesunsite.dk
For additional commands, e-mail: gug-helpsunsite.dk


Re: converting tiff to jpeg (incl. resizing)
user name
2007-08-01 13:46:59
I can use php? This would be great. I´ll go searching for
it on google ;)

Your bash script works fine. Thanks.

-- Jan
> Hello Jan Pieper.
>
> If you are talking about batch conversion (many images
at once), you have two options that I am aware of:
>
> 1) Write a small GIMP program using
"Script-Fu" (or Perl, Python, PHP, etc.) from the
Xtns menu.  This will take a bit of learning if you haven't
done a script before, but it is certainly doable.  There are
many guides available on the web with introductory examples
of how to do the things you want (scale, save as, close) an
image.
>
> 2) Use the command line utility "convert"
from the ImageMagick program suite.  It is available for
most operating systems.  It is very easy to script convert
using a DOS/Windows batch/cmd script, or a Unix shell
script.
>
> e.g. a GNU Bash script:
>
> #!/bin/bash
>
> for image in *.tiff; do
>
>    convert "$image" -resize 800x600 -quality
90 "$(basename "$image"
".tiff").jpg"
>
> done
>
> For a Windows batch script you would need to use a
similar for loop, though there is no equivalent to the
"basename" command, so you will end up with
filenames such as "foo.tiff.jpg".
>
> G'day,
>
>  - raven morris
>
>
>
>
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: gug-unsubscribesunsite.dk
> For additional commands, e-mail: gug-helpsunsite.dk
>
>   


------------------------------------------------------------
---------
To unsubscribe, e-mail: gug-unsubscribesunsite.dk
For additional commands, e-mail: gug-helpsunsite.dk


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )