Re: [Gimp-user] Multiple file scaling

2005-06-25 Thread nuno alexandre
On Sat, 2005-06-25 at 11:56 +0200, Sven Neumann wrote:
> Hi,

Hello :)

> > nuno alexandre <[EMAIL PROTECTED]> writes:
> > src: http://adrian.gimp.org/batch/batch-7.html
> 
> That page is old and what's said there isn't true any longer.
> gimp/script-fu has a way to easily iterate over all image files that
> match a file glob pattern. The Batch Mode tutorial on gimp.org
> explains how to do this.


Actually you are not the first one to email me /post about this.
My apologizes.


nuno

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-25 Thread Sven Neumann
Hi,

nuno alexandre <[EMAIL PROTECTED]> writes:

> I quote:
>
> "Batch mode is slow. Its not really a practical replacement for tools
> like ImageMagick or NetPBM when it comes to large scale image
> conversions or similar. At least not without writing some very clever
> scripts. 
>
> The problem with this approach is that gimp/script-fu has no built in
> procedures to itterate though a list of images. So you cant easily tell
> gimp to load up *.jpg and run predator.scm on them, at least not without
> it taking a _long_ time.
>
> So you could write a shell script to fire up gimp in batch mode for each
> image, but that starts a new gimp for every image. And gimp startup time
> is very very slow, especially if you plan to repeat ir a few hndred
> times."
>
> src: http://adrian.gimp.org/batch/batch-7.html

That page is old and what's said there isn't true any longer.
gimp/script-fu has a way to easily iterate over all image files that
match a file glob pattern. The Batch Mode tutorial on gimp.org
explains how to do this.


Sven
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread David Hodson

Jon Lapham wrote:


Okay, I've installed your plugin, wow, really nice work!


Thanks, glad you like it.


I have a few suggestions, do you want this discussion on the Gimp
Users list, private email, or some other mailing list?


May as well take it to email, unless you think anyone else
here would be interested.


--
David Hodson  --  this night wounds time
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread Jon Lapham

David Hodson wrote:

Jon Lapham wrote:

Is it possible to rescale multiple images (ie: hundreds) without 
having to open each one individually in the Gimp?  I guess this would 
be a sort of batch processing.



David's Batch Processor (DBP) is a Gimp plugin to do exactly this.
Look at http://members.ozemail.com.au/~hodsond/dbp.html


Okay, I've installed your plugin, wow, really nice work!

I have a few suggestions, do you want this discussion on the Gimp Users 
list, private email, or some other mailing list?


-Jon

--
-**-*-*---*-*---*-*---*-*-*-*---*-*---*-*-*-*-*---
 Jon Lapham  <[EMAIL PROTECTED]>Rio de Janeiro, Brasil
 Personal: http://www.jandr.org/
***-*--**---***---

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread Mike Gimp
> I can say that you are better suited with ImageMagick and, like you
> said, your custom perl scripts.
> I quote:
> 
> "Batch mode is slow. Its not really a practical replacement for tools
> like ImageMagick or NetPBM when it comes to large scale image
> conversions or similar. At least not without writing some very clever
> scripts.
> 
> The problem with this approach is that gimp/script-fu has no built in
> procedures to itterate though a list of images. So you cant easily tell
> gimp to load up *.jpg and run predator.scm on them, at least not without
> it taking a _long_ time.
> 
> So you could write a shell script to fire up gimp in batch mode for each
> image, but that starts a new gimp for every image. And gimp startup time
> is very very slow, especially if you plan to repeat ir a few hndred
> times."
> 
> src: http://adrian.gimp.org/batch/batch-7.html

that web page is from 1998
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread Joao S. O. Bueno Calligaris

On Friday 24 June 2005 10:28, Jon Lapham wrote:
> nuno alexandre wrote:
> > you can use convert from ImageMagick.
> > [snip shell script]
>
> As I mentioned, I have a perl script (incidently using the
> ImageMagick module) which does exactly what your shell script does.
>
> I was just curious if/how the Gimp could do it, as I use the Gimp
> for all my image processing except for this one step.

Using Python Scripting it would be a matter of a few lines. The only
drawback is that you'd have to change the script code for each
processing job you need to do in the batch.

I will post here the Python script needed to rotate each image in a
dir by 270 degrees and saving the result with an "R" appended to the
filename.

I apologize for the portuguese names inside the code - I had used
 this script as an example ina local forum.

You have to replace the line  "pdb.gimp_image_rotate (...)" for the
actions you need applied to the image (check what is available in the
GIMP Procedure Browser in the  Xtns menu). Offcourse, you also need
gimp-python  installed (it is tehre if you have a "python-fu" menu
entry. Else, it is usually available from Linux distros as a
separate package, or you have to give ./configure an
"--enable-python" option if you compile your own GIMP.


--

#! /usr/bin/python
from gimpfu import *
import os
def rotacao_em_massa (diretorio):
for arquivo in os.listdir (diretorio):
nome = os.path.join (diretorio, arquivo)
imagem = pdb.gimp_file_load (nome, nome)
pdb.gimp_image_rotate (imagem, ROTATE_270)
tmp = arquivo.split(".")
novo_nome = os.path.join (diretorio, tmp[0] + "R" + tmp[1])
pdb.gimp_file_sabe (imagem, imagem.layers[0],
novo_nome, novo_nome)
register(
"rotacao_em_massa",
"Rotaciona as imagens em um diretório",
"rotacao_em_massa (diretorio) -> None",
"Joao S. O. Bueno Calligaris",
"(k) All rites reversed - reuse whatever you like- JS",
"2005",
"/Python-Fu/Rotacionar em Massa",
"*",
[(PF_FILE, "diretorio", "diretorio a transformar",""),
],
[],
rotacao_em_massa)
main()

> Thanks, Jon

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread David Hodson

nuno alexandre wrote:


I quote:

[...]

src: http://adrian.gimp.org/batch/batch-7.html


I quote http://adrian.gimp.org/batch/batch.html, the contents page
for that document:

"NOTE: This doc is ancient. It it wrong. You really want to look at 
Basic_Batch instead."


That's http://gimp.org/tutorials/Basic_Batch/

Or you can use my plugin, which doesn't allow every image operation
(just the common ones), but is entirely interactive, so you don't
have to worry about writing a script.

--
David Hodson  --  this night wounds time
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread Jon Lapham

David Hodson wrote:

Jon Lapham wrote:

Is it possible to rescale multiple images (ie: hundreds) without 
having to open each one individually in the Gimp?  I guess this would 
be a sort of batch processing.


David's Batch Processor (DBP) is a Gimp plugin to do exactly this.
Look at http://members.ozemail.com.au/~hodsond/dbp.html


Yes, this looks very promising.  Thanks for the link!

--
-**-*-*---*-*---*-*---*-*-*-*---*-*---*-*-*-*-*---
 Jon Lapham  <[EMAIL PROTECTED]>Rio de Janeiro, Brasil
 Personal: http://www.jandr.org/
***-*--**---***---

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread David Hodson

Jon Lapham wrote:

Is it possible to rescale multiple images (ie: hundreds) without having 
to open each one individually in the Gimp?  I guess this would be a sort 
of batch processing.


David's Batch Processor (DBP) is a Gimp plugin to do exactly this.
Look at http://members.ozemail.com.au/~hodsond/dbp.html


--
David Hodson  --  this night wounds time
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread Carol Spears
On Fri, Jun 24, 2005 at 10:28:51AM -0300, Jon Lapham wrote:
> nuno alexandre wrote:
> >you can use convert from ImageMagick.
> >[snip shell script]
> 
> As I mentioned, I have a perl script (incidently using the ImageMagick 
> module) which does exactly what your shell script does.
> 
> I was just curious if/how the Gimp could do it, as I use the Gimp for 
> all my image processing except for this one step.
> 
if the files are named logically, gap can do this.

if you have pygimp installed, you can easily modify my python gallery
scripts to do this.
http://carol.gimp.org/gimp2/web/python/gallery-simple.py

it scales images and writes html.

carol

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread nuno alexandre
On Fri, 2005-06-24 at 10:28 -0300, Jon Lapham wrote:
> nuno alexandre wrote:
> > you can use convert from ImageMagick.
> > [snip shell script]
> 
> As I mentioned, I have a perl script (incidently using the ImageMagick 
> module) which does exactly what your shell script does.
> 
> I was just curious if/how the Gimp could do it, as I use the Gimp for 
> all my image processing except for this one step.

>From what I've found on the net, related to theGimp capabilities to do
batch jobs,
I can say that you are better suited with ImageMagick and, like you
said, your custom perl scripts.
I quote:

"Batch mode is slow. Its not really a practical replacement for tools
like ImageMagick or NetPBM when it comes to large scale image
conversions or similar. At least not without writing some very clever
scripts. 

The problem with this approach is that gimp/script-fu has no built in
procedures to itterate though a list of images. So you cant easily tell
gimp to load up *.jpg and run predator.scm on them, at least not without
it taking a _long_ time.

So you could write a shell script to fire up gimp in batch mode for each
image, but that starts a new gimp for every image. And gimp startup time
is very very slow, especially if you plan to repeat ir a few hndred
times."

src: http://adrian.gimp.org/batch/batch-7.html




nuno

-- 
"Non-free programs are dangerous to you and to your community.
Don't let them get a place in your life." - RMS

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread Jon Lapham

nuno alexandre wrote:

you can use convert from ImageMagick.
[snip shell script]


As I mentioned, I have a perl script (incidently using the ImageMagick 
module) which does exactly what your shell script does.


I was just curious if/how the Gimp could do it, as I use the Gimp for 
all my image processing except for this one step.


Thanks, Jon

--
-**-*-*---*-*---*-*---*-*-*-*---*-*---*-*-*-*-*---
 Jon Lapham  <[EMAIL PROTECTED]>Rio de Janeiro, Brasil
 Personal: http://www.jandr.org/
***-*--**---***---

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Multiple file scaling

2005-06-24 Thread nuno alexandre
On Fri, 2005-06-24 at 10:03 -0300, Jon Lapham wrote:
> Hello list,
> 
> Is it possible to rescale multiple images (ie: hundreds) without having 
> to open each one individually in the Gimp?  I guess this would be a sort 
> of batch processing.
Hi,
you can use convert from ImageMagick.
cd /dir/with_images/
for image in *; do convert -scale 100x100 $image $image; done

check the man page for more info :)


nuno
-- 
"Non-free programs are dangerous to you and to your community.
Don't let them get a place in your life." - RMS

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


[Gimp-user] Multiple file scaling

2005-06-24 Thread Jon Lapham

Hello list,

Is it possible to rescale multiple images (ie: hundreds) without having 
to open each one individually in the Gimp?  I guess this would be a sort 
of batch processing.


Background: I have a perl script which I run to shrink images before 
uploading to the web.  This typically shrinks the size (and thus upload 
times) of my huge 8MPixel JPEG files from 3-4MB to a few hundred KB. 
This works great, and I use this script all the time.  I just thought it 
would be great if the Gimp could do something similar, as I imagine this 
"shrink many images before upload" is a process that many people need to do.


Thanks!
-Jon

--
-**-*-*---*-*---*-*---*-*-*-*---*-*---*-*-*-*-*---
 Jon Lapham  <[EMAIL PROTECTED]>Rio de Janeiro, Brasil
 Personal: http://www.jandr.org/
***-*--**---***---

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user