|
Posted by Jim Higson on 03/10/06 16:36
Terry Pinnell wrote:
> Jim Higson <jh@333.org> wrote:
>
>>In general, the command line is good because it lets you do things the
>>original program creators didn't think of. For example, I recently had to
>>produce raster images containing the first few hundread square numbers. I
>>don't think this could have easily been done with GUI software.
>
> Thanks.
>
> I'm curious about that interesting last point. You mean you had to
> produce N images, each just containing a single number 1, 4, 9... etc?
> Of a certain size and font/background colour?
>
> If so, I suppose I'd have fired up IrfanView and played with my
> keystroke-entering macro program, Stiletto (now obsolete), to automate
> a series of operations like:
> - Open new file
> - Draw a text rectangle
> - Copy text from a pre-established Excel column, selecting next row
> each time
> - Pasted it into IV's text box (using pre-established font size and
> colour, etc)
> - Saved file
Ok, I suppose this would be *possible* in a GUI, but it is much simpler as
scripting once you are familiar with it because you have direct access to
loops, maths etc.
Also, GUI-imitating macros can fail if the layout of Excel or whatever
changes in future.
Maybe you are familiar with a scripting language such as PHP? I mention PHP
because it is often used to make HTML so it is likely you are familiar with
it, this being alt.html and all, but there are many other languages that
could be used for this task.
The PHP-ish psudo-code is something like:
for( $i = 0 to 200 )
{ $square = $i*$i;
`convert base_image.png --write $square numberedimage-$i.png`;
}
Another interesting possiblity is generating images on a web server as
requested, in the same way that many servers only generate HTML as it is
asked for. You can do some funky stuff this way.
--
Jim
Navigation:
[Reply to this message]
|