I just found this script which
apparently uses Gimp to automatically
resize images:
Auto convert ad resize images (new)
Looks like it comes with a tutorial:
Resize Image Tutorial
The tutorial is in Italian. I do
not know Italian. However, I've
gathered from what I can see that
the way this thing works is as follows:
- Create a text file, one image
filename per line - Run the script
- Look for a dialog
that comes up - In the dialog, specify
the name of the text file - In the dialog, specify the
size you wish all your images to
resize to.
This is not exactly what I was
looking for. However, I may try
it anyway. It may be worth a
try.
Some time later . . .
OK. I"m back. I just did a search on
the name of this tutorial with
Google. Google offered to translate
it into English for me and I accepted
their offer. Amazing technology!
Actually, I think I can use this script.
I'm going to try it now.
OK. I'm back again after having tried
the script.
This script worked better than I thought
it would. The hardest thing about it is
getting the idea.
Since I wanted to use it to scale an image
downward, I used the scale option.
First thing I did was to build a text file
that had all the names of the images I
wished to process. I called this file,
work.txt as it seems that a .txt
is recommended (required?).
The script provides you with a file dialog
that allows you to navigate to the text file.
The documentation seems to be saying that each
image filename inside the text file needs a full
path name. In addition, each full path must be
on a separate line and surrounded by double quotes.
I did that. I gave each image its own line in
the text file. I made sure that each image had
a full path starting at the root directory. In
addition, I surrounded each full path with double
quotes.
After having picked the scale option, I
left the preserve aspect ratio checkmarked.
Next, I was asked to put a height and width in.
This is where I got confused. Height and width
in terms of what? Percentages? Pixels?
It turns out that the height and width are both
in pixels. This makes sense.
Another thing that confused me on first glance
was the fact that I had to give both a height and
a width. Since I'm preserving the aspect ratio,
shouldn't I only give just one these parameters?
Why give both?
This was cleared up for me when I realized that
height and width are really maximum height
and maximum width. Once I realized this,
it was simple. Just choose one parameter as the
active parameter and make the other parameter,
the inactive parameter, ridiculously big.
For example, lets say I wish to make all the images
100 pixels wide. That being the case, I would
choose 100 pixels for the width and 1,000 or more
pixels for the height.
The ridiculous parameter, the one that will inevitably
be ignored, is the parameter that is 1,000 pixels
(or greater). Therefore, all the images will be scaled
to a 100 pixel width. The fact that the aspect ratio is
preserved means that the height will be calculated based
on the width and will be considerably less than 1,000
pixels.
In other words, when you are scaling images and preserving
aspect ratio at the same time, only the small number really
counts. That is to say, only the smallest number in terms
of the aspect ratio really counts.
Is height smaller than width? Then height matters. Is
width smaller than height? Then width matters.
In other words, each parameter is a maximum, and generally
speaking, only one of the parameters matters when scaling
images.
Of course, you want to choose an output format. I choose
.gif just to make a choice.
Where in Gimp is the script found? What menu is it in?
Here's where I found it:
Xtns > Script-Fu > ATG > Auto convert and resize
Oddly enough, there are two menus called
Script-Fu located under the Xtns menu.
I'm not sure why this is. In any case, it
is the second Script-Fu menu that matters.
How did I install the script? I followed these
simple steps:
- Download the script
- Unzip it
- Place it in the proper place
- Restart Gimp
The proper place to place the script
will probably vary depending on your
operating system. In my case, I'm
using the script under Linux.
I placed it such that it was my personal
script rather than a system-wide script.
I placed it here:
~/.gimp-2.4/scripts
In other words, I placed it in my home
directory which contains a hidden directory
(folder) called .gimp-2.4. Underneath
the hidden directory is something called
scripts. If you place it there, Gimp
automatically finds it upon restart.
My initial impression was that I would not find
this script particularly useful. In fact, I found
it to be quite useful.
The lesson? Investigate a little bit before coming
to a conclusion.
Ed Abbott
No comments:
Post a Comment