[Gimp-user] scripting

2009-12-30 Thread Elwin Estle
Is it in the plan to remove the scheme scripting in Gimp and go to all Python 
scripting?  Is there much of a difference between what can be done with 
either?  I have tried a couple of times to learn Python, but I am an old fogy 
and keep coming up against a wall whenever I try to get my head around the 
whole object oriented programming thing (yes, I know, Python can do procedural 
just fine...but it seems like OOP is a sort of central concept to a lot of what 
python is capable of..)

Anybody got any good recommendations for books for learning Python?  Especially 
ones that actually give a clear explanation of the the whole OOP thing in a 
Python context?  I've found stuff that kind of explains things for other 
languages, but that doesn't help with understanding things from a Python 
specific point of view.  I've gotten a Python for Dummies book...but...it seems 
I am too dumb even for that.

I'd really like to get a handle on this, since Python scripts both Inkscape and 
Blender as well.

I've been tinkering with computers for over 20 years, but my programming 
experience, what there is of it, is pretty much in procedural.  Some Pascal 
(back in the 80's), various flavors of BASIC, mostly on old Atari 8-bit 
machines, some on Commodor64, Action --think of a cross between C and Pascal, 
it ran on the Atari--, and lately, Tcl/Tk (Not explicitly OOP, but it is 
supposedly capable of it), on Win and Linux.



  ___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] scripting

2009-12-30 Thread Patrick Horgan
Elwin Estle wrote:

#1 is Core Python Programming by Wesley Chun.  He covers everything.  
There are gotchas in there that you'd have to program in python for 
years to learn, all in a nice clear, well organized, progressive, 
understandable format.  Good reference material in the back too.  
Couldn't do better than this.

Mark Lutz's book Learning Python from O'Reilly is pretty good.  He did 
another python book earlier that was awful, a jillion concepts lightly 
touched and no organization, but this one's pretty good.

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] scripting

2009-12-30 Thread Colin J. Williams






On 30-Dec-09 10:42 AM, Elwin Estle wrote:

  

  
Is it in the plan to remove the scheme scripting in Gimp
and go to all Python scripting? Is there much of a difference between
what can be done with either? I have tried a couple of times to learn
Python, but I am an old fogy and keep coming up against a wall whenever
I try to get my head around the whole object oriented programming thing
(yes, I know, Python can do procedural just fine...but it seems like
OOP is a sort of central concept to a lot of what python is capable
of..)

Anybody got any good recommendations for books for learning Python?
Especially ones that actually give a clear explanation of the the whole
OOP thing in a Python context? I've found stuff that kind of explains
things for other languages, but that doesn't help with understanding
things from a Python specific point of view. I've gotten a Python for
Dummies book...but...it seems I am too dumb even for that.

I'd really like to get a handle on this, since Python scripts both
Inkscape and Blender as well.

I've been tinkering with computers for over 20 years, but my
programming experience, what there is of it, is pretty much in
procedural. Some Pascal (back in the 80's), various flavors of BASIC,
mostly on old Atari 8-bit machines, some on Commodor64, Action --think
of a cross between C and Pascal, it ran on the Atari--, and lately,
Tcl/Tk (Not explicitly OOP, but it is supposedly capable of it), on Win
and Linux.

  

  
  

I like Alex Martelli's Python in a Nutshell but, especially with the
introduction with Python 3, you might prefer Mark Summerfield's
Python 3. Most people are continuing to use Python 2.6 for now.

Colin W.


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Scripting - How to save JPEG with thumbnails

2007-05-07 Thread Guillaume Bonillo
Hi,

I am new to scheme scripting.
What i want to do is open pictures from a directory and apply a very 
simple macro.

I can do it manually with the following steps :
- open image the_image.jpg.
- save as  the_image_with_thumbnail.jpg
- choose options : q = 0.85 , progressive, and default other options.
- check the option : save thumbnail.
- Click OK.
- close image.

Could someone show me some sample scripts to do that ?
I've found several way to save a thumbnail in jpg or png format in a 
separate file,
but did not find any script matching the steps i've exposed ...

Thanks for any reply

G.B.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting - How to save JPEG with thumbnails

2007-05-07 Thread Guillaume Bonillo

Guillaume Bonillo a écrit :

Paul Surgeon a écrit :

On Monday 07 May 2007 11:37, Guillaume Bonillo wrote:
  

Hi,

I am new to scheme scripting.
What i want to do is open pictures from a directory and apply a very
simple macro.

I can do it manually with the following steps :
- open image the_image.jpg.
- save as  the_image_with_thumbnail.jpg
- choose options : q = 0.85 , progressive, and default other options.
- check the option : save thumbnail.
- Click OK.
- close image.



Using a bash script or DOS batch file with imagemagick is a better and easier 
solution.


Below is a bash script that I use to create thumbnails of photos from my 
digital camera.
You can pass the jpg quality parameter to convert - I used the default which 
is 75% I think. The options are in the docs.


-

#!/bin/bash

echo Converting ...

if [ ! -d resized-1024x768 ]
then
  mkdir resized-1024x768
fi

if [ ! -d resized-256x192 ]
then
  mkdir resized-256x192
fi

# Loop through all jpg files in current folder
# 
for i in *.jpg
do
  FileName_Stripped=`echo $i | cut -d. -f1`

  if [ ! -e resized-1024x768/$FileName_Stripped-1024x768.jpg ]
  then
echo Converting $i to $FileName_Stripped-1024x768.jpg
convert -resize 1024x768 
$i resized-1024x768/$FileName_Stripped-1024x768.jpg

  fi

  if [ ! -e resized-256x192/$FileName_Stripped-256x192.jpg ]
  then
echo Converting $i to $FileName_Stripped-256x192.jpg
convert -resize 256x192 
$i resized-256x192/$FileName_Stripped-256x192.jpg

  fi
done

echo Done

-
  

Thank you very much for pointing this tool to me.
However ...
I can't find in imagemagick the ability to save thumbnail as EXIF data 
in the jpeg, and not in a different picture.


Ok, so if someone want to write Exif thumbnail to jpeg i've done this 
with imagemagik and exiftools to write thumbnail generated by imagemagik...
Maybe there's a better way to do this but this tools works just as 
expected and there's no loss of other exif info.


But if someone ever got a scheme script to do that through GIMP ... i'am 
interested


Thanks list !
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting - How to save JPEG with thumbnails

2007-05-07 Thread Sven Neumann
Hi,

On Mon, 2007-05-07 at 11:37 +0200, Guillaume Bonillo wrote:

 I am new to scheme scripting.
 What i want to do is open pictures from a directory and apply a very 
 simple macro.
 
 I can do it manually with the following steps :
 - open image the_image.jpg.
 - save as  the_image_with_thumbnail.jpg
 - choose options : q = 0.85 , progressive, and default other options.
 - check the option : save thumbnail.
 - Click OK.
 - close image.

It's acutally a bad idea to do that. When you are opening a JPEG file
and saving it again as JPEG, you are recompressing it and this
recompression means a loss of quality. This can be avoided by using a
tool that manipulates the JPEG file without recompressing the image
data. Such tools are available and they can even rotate the image for
you without decompressing the image data. See for example exiv2
(http://www.exiv2.org/). The manual page says that it can insert
thumbnails.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Scripting questions...

2006-11-26 Thread Jerry Baker
Using python, I'm trying to find the color that is used on a layer. The 
layer has an alpha channel and it only uses 1 color on the layer. The 
problem is, I don't know where the colored pixels are. It may only  be 
one pixel anywhere on the layer, or the entire layer may be filled.

I also need to find the color used on a text layer...

Anyone have any ideas ?

Thanks a million...

jbaker
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Scripting font hinting

2003-09-16 Thread John Green
I've just moved some of my 1.2 scripts to 1.3 and I notice that text layers
are created with font hinting toggled on. Looking at DB browser, hinting is
not an option in gimp-text-fontname so how can this be set from a script?

-- 
John Green
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting font hinting

2003-09-16 Thread Sven Neumann
Hi,

John Green [EMAIL PROTECTED] writes:

 I've just moved some of my 1.2 scripts to 1.3 and I notice that text
 layers are created with font hinting toggled on. Looking at DB
 browser, hinting is not an option in gimp-text-fontname so how can
 this be set from a script?

It cannot be set since you are using the compatibility API. There are
no new PDB calls for the text tool yet but I plan to add them when the
time has come. If you absolutely need to turn off hinting, you will
have to wait for the new API, compile freetype w/o hinting or patch
the GIMP.


Sven
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting font hinting

2003-09-16 Thread John Green
On Tue, Sep 16, 2003 at 03:19:42PM +0200, Sven Neumann wrote:
 
 It cannot be set since you are using the compatibility API. There are
 no new PDB calls for the text tool yet but I plan to add them when the
 time has come. If you absolutely need to turn off hinting, you will
 have to wait for the new API, compile freetype w/o hinting or patch
 the GIMP.
 
 
Thanks, I wondered why I couldn't find anything. It's just that a font I was
using looked pretty ugly with hinting on. So I just used a different font.
-- 
John Green
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting for resize

2003-07-16 Thread Sven Neumann
Hi,

Paulo J Matos [EMAIL PROTECTED] writes:

I'm just new to script-fu and gimp. I was not aware scheme is used for
scripting in gimp. I loved that. :D Anyway, I've read the script-fu
part of the gimp manual. I have a directory tree with about 1000
images and I'd like to resize them all to 20x20. Is there any script
for doing that?

 for i in '*.png'; do convert -sample 20x20 $i  small-$i; done

Not a GIMP script but probably a lot better suited for this job.


Sven
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scripting for resize

2003-07-16 Thread pcg
On Wed, Jul 16, 2003 at 06:14:53PM +0200, Sven Neumann [EMAIL PROTECTED] wrote:
 I'm just new to script-fu and gimp. I was not aware scheme is used for
 scripting in gimp. I loved that. :D Anyway, I've read the script-fu
 part of the gimp manual. I have a directory tree with about 1000
 
  for i in '*.png'; do convert -sample 20x20 $i  small-$i; done

Sticking a ! at the end of the 20x20 will actually do the job.

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED]  |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user