[Gimp-user] Script Problem

2005-02-22 Thread Graham Smith
Hi,
I've got a bit of a problem with a script that I make fairly extensive 
use of to create buttons for websites. It started out life as a GIMP-1.1 
script and I upgraded it to work with GIMP-2.0 but have recently 
upgraded again to GIMP-2.2. Unfortunately this has broken the script 
(right when I need it of curse) and I can't figure out what is wrong.

The offending section is below with a comment above the first line that 
breaks. According to the PDB gimp-edit-fill requires a drawable and an 
int32 which I think I am giving it but it just dies with Procedural 
database execution failed. Any ideas? If you want to see the full 
script it is hosted here:

http://www.crazysquirrel.com/software/gimp/aqua_gimp_2_0.scm
If I can fix this I will of course make a new version of the script 
available.

Many Thanks
---
(if (eqv? shadow TRUE)
  (begin
(set! shadow1-layer (car (gimp-layer-new img width-all height-all 1 
Shadow Layer1 100 SCREEN)))
(set! shadow2-layer (car (gimp-layer-new img width-all height-all 1 
Shadow Layer2 100 NORMAL)))
(gimp-image-add-layer img shadow2-layer -1)
(gimp-image-add-layer img shadow1-layer -1)
(gimp-drawable-fill shadow2-layer TRANS-IMAGE-FILL)
(gimp-drawable-fill shadow1-layer TRANS-IMAGE-FILL)

(round-select img shiftx shifty width height ratio)
(gimp-selection-shrink img (* height 0.1))
;This is where it breaks first
(gimp-edit-fill shadow1-layer FG-IMAGE-FILL)
(gimp-hue-saturation shadow1-layer 0 0 75 0)
(gimp-selection-grow img (+ 1 (* bluramount 0.3)))
(plug-in-gauss-iir2 1 img shadow1-layer (+ 1 (* bluramount 0.3)) (+ 
1 (* bluramount 0.3)))
(gimp-drawable-offset shadow1-layer 0 1 0 (* height 0.4))
(gimp-selection-none img)


(round-select img shiftx shifty width height ratio)
(gimp-edit-fill shadow2-layer FG-IMAGE-FILL)
(gimp-hue-saturation shadow2-layer 0 0 0 -25)
(gimp-selection-grow img (+ 1 (* bluramount 0.3)))
(plug-in-gauss-iir2 1 img shadow2-layer (+ 1 (* bluramount 0.3)) (+ 
1 (* bluramount 0.3)))
(gimp-drawable-offset shadow2-layer 0 1 0 (* height 0.4))
(gimp-selection-none img)

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


RE: [Gimp-user] Color Reduction with GIMP

2005-02-22 Thread Kalle Ounapuu
This method does not deliver what I require. But thank you for helping me learn 
how to manage palette's.

What I need through GIMP is a way to remove individual colours from the image 
dynamically in real-time. For example, I would click one colour to turn it 
off and see the change to the image. If the image isn't severely affected by 
turning off that one colour, then that colour should be removed.

I deal with images that are only 2-64 colours each, and shaving off colours is 
a huge importance to get the filesize down to the absolute smallest.

Currently I use Web Image Guru to do this. Great program. But it costs money. 
The programmers I work with are all interested in installed GIMP on their 
machines. So going through GIMP, I haven't been able to easily reduce colours 
of an image on-the-fly.

Thanks



-Original Message-
From: Carol Spears [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 5:19 PM
To: Kalle Ounapuu; GIMPUser
Subject: Re: [Gimp-user] Color Reduction with GIMP


On Mon, Feb 21, 2005 at 02:53:58PM -0500, Kalle Ounapuu wrote:
 In GIMP, is there an area where I can lock/remove individual colours in an 
 Indexed colour palette of an image?
 
 I was able to see a colour table Dialog in GIMP, where I could edit RGB 
 values and add an additional colour. But I couldn't see anyway to remove 
 colours or lock them from being removed.
 
if the image is already in Indexed mode, you can import the palette
directly from the image via the palette palette (Dialogs --Palette).
gimp palettes are simple text files and can be edited via the palette
editor or even directly with a text editor of your choice if you can 
find it in your user directory.

to apply it to your image, change the mode of the image to rgb and then
index it again using your edited palette.

carol

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


Re: [Gimp-user] Color Reduction with GIMP

2005-02-22 Thread Joao S. O. Bueno Calligaris
On Tuesday 22 February 2005 14:02, Kalle Ounapuu wrote:
 This method does not deliver what I require. But thank you for
 helping me learn how to manage palette's.

 What I need through GIMP is a way to remove individual colours from
 the image dynamically in real-time. For example, I would click one
 colour to turn it off and see the change to the image. If the
 image isn't severely affected by turning off that one colour,
 then that colour should be removed.

 I deal with images that are only 2-64 colours each, and shaving off
 colours is a huge importance to get the filesize down to the
 absolute smallest.

 Currently I use Web Image Guru to do this. Great program. But it
 costs money. The programmers I work with are all interested in
 installed GIMP on their machines. So going through GIMP, I haven't
 been able to easily reduce colours of an image on-the-fly.

dialogs-colormap.

I think it was dialogs-palette up to GIMP 2.0.

It doesn't allow you to remove colors, but you can change palette 
entries of the active colormap on the fly, and after all redundant 
colors are set to be equal to another existing color, just do the 
mode-rgb, mode-indexed thing.



 Thanks



 -Original Message-
 From: Carol Spears [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 21, 2005 5:19 PM
 To: Kalle Ounapuu; GIMPUser
 Subject: Re: [Gimp-user] Color Reduction with GIMP

 On Mon, Feb 21, 2005 at 02:53:58PM -0500, Kalle Ounapuu wrote:
  In GIMP, is there an area where I can lock/remove individual
  colours in an Indexed colour palette of an image?
 
  I was able to see a colour table Dialog in GIMP, where I could
  edit RGB values and add an additional colour. But I couldn't see
  anyway to remove colours or lock them from being removed.

 if the image is already in Indexed mode, you can import the palette
 directly from the image via the palette palette (Dialogs
 --Palette). gimp palettes are simple text files and can be edited
 via the palette editor or even directly with a text editor of your
 choice if you can find it in your user directory.

 to apply it to your image, change the mode of the image to rgb and
 then index it again using your edited palette.

 carol

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


RE: [Gimp-user] Color Reduction with GIMP

2005-02-22 Thread Kalle Ounapuu
Once a colour would be removed from the palette, the pixels in the image should 
change to the closest matching colour in the palette. There would be an 
algorithm that chooses the replacement colour.

If you have seen Photoshop or Image Ready's Save For Web feature, you have 
seen this. You are presented with not only a colour limited (Choose a number 
between 1 and 256), but it displays the entire colour palette and you able to 
manually select colours to LOCK or REMOVE from the palette, and you can see the 
preview of the palette changes on the image before you save.

There's an image browser and batch processor called Web Image Guru by Vimas 
that does this task most excellently. This is what I use on a day to day basis. 
But it isn't a free tool like GIMP is. The other people I work with are very 
interested in using GIMP for all our imaging needs... and it does almost 
everything... except for good colour reduction.


-Original Message-
From: Andreas Waechter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 12:18 PM
To: Kalle Ounapuu
Subject: Re: [Gimp-user] Color Reduction with GIMP


 What I need through GIMP is a way to remove individual 
  colours from the image dynamically in real-time. For
  example, I would click one colour to turn it off and
  see the change to the image. If the image isn't
  severely affected by turning off that one colour,
  then that colour should be removed.

What should happen with the pixels that have the color you 
want to remove?

Should they go transparent?

If so, select by color with threshold set to zero, then 
clear selection.

Should they be replaced by another color?

If so, select by color with threshold set to zero, then fill 
selection with the other color.

Or should something else happen to those pixels? If so, what?

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


Re: [Gimp-user] Color Reduction with GIMP

2005-02-22 Thread Joao S. O. Bueno Calligaris
On Tuesday 22 February 2005 15:45, Kalle Ounapuu wrote:
 Once a colour would be removed from the palette, the pixels in the
 image should change to the closest matching colour in the palette.
 There would be an algorithm that chooses the replacement colour.


Hi -
could you open an enhancement request in 
bugzilla.gnome.org for this?
I believe it has good chances of coming in for GIMP 2.4.


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


Re: [Gimp-user] Script Problem

2005-02-22 Thread Sven Neumann
Hi,

Graham Smith [EMAIL PROTECTED] writes:

 I've got a bit of a problem with a script that I make fairly
 extensive use of to create buttons for websites. It started out life
 as a GIMP-1.1 script and I upgraded it to work with GIMP-2.0 but
 have recently upgraded again to GIMP-2.2. Unfortunately this has
 broken the script (right when I need it of curse) and I can't figure
 out what is wrong.

You are using deprecated constant names (FG-IMAGE-FILL should be
FOREGROUND-FILL). I am however somewhat surprised since the old names
are still supposed to work. Try if starting gimp with the
'--pdb-compat-mode on' or '--pdb-compat-mode warn' command-line
options makes a difference.


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


Re: [Gimp-user] Re: Cpu usage and speed

2005-02-22 Thread Sven Neumann
Hi,

Michele Petrazzo [EMAIL PROTECTED] writes:

 Did you use the default value for the tile cache size, or did you
 adjust it? The default value is 128 MB IIRC, but if you're going to
 open large images and you have 1 GB of RAM, it should be much
 higher than that.

 On linux machine I found only maximum size of new image

Look again then; it's in the Environment preferences page. And GIMP
did also explain this setting to you when it run the user installation.


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


[Gimp-user] Dragging (moving) a selection

2005-02-22 Thread Maciej Zięba
Hi :)
I've just started using GIMP in Linux and I've come to a problem. I
suppose the answer is simple but I've looked and tried everything that
came to my mind...
Let's say I make a rectangular selection but it turns out it doesn't
exactly select the area it was supposed to. So I would like to drag
(move) the selection (and only selection, not the part of image that
is selected) to some other place.
In Windows I would press the Alt key and drag with my right mouse button
but In Linux I cannot - instead of the selection I'm moving the entire
GIMP window! :-O
So is there a way I can move the selection and not the part of image it
select, nor the window?
Regards,
Maciej Ziba
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Dragging (moving) a selection

2005-02-22 Thread Sven Neumann
Hi,

Maciej Ziba [EMAIL PROTECTED] writes:

 I've just started using GIMP in Linux and I've come to a problem. I
 suppose the answer is simple but I've looked and tried everything that
 came to my mind...

 Let's say I make a rectangular selection but it turns out it doesn't
 exactly select the area it was supposed to. So I would like to drag
 (move) the selection (and only selection, not the part of image that
 is selected) to some other place.

 In Windows I would press the Alt key and drag with my right mouse button
 but In Linux I cannot - instead of the selection I'm moving the entire
 GIMP window! :-O

 So is there a way I can move the selection and not the part of image it
 select, nor the window?

Sure, two ways even:

(1) Reconfigure your window manager to not use the Alt key (you could
for example let it use the Windows key, provided your keyboard has
one).
(2) Press Shift together with Alt.


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


Re: [Gimp-user] Script Problem

2005-02-22 Thread Sven Neumann
Hi,

Graham Smith [EMAIL PROTECTED] writes:

 --pdb-compat-mode on : made no difference

It shouldn't since that's the default. But I wanted to make sure. I
also checked the code and the old enums are always available. The
command-line option only affects deprecated function names.

 --pdb-compat-mode warn : produced the following error messages on stdout

These warnings indicate that you should port your code to the new
context API. It will continue to work with the old API but the new
stuff has some advantages. You can call gimp-context-push /
gimp-context-pop around your script and have it run in it's own
context, thus not affecting the foreground/background colors in the
user context.

 Using the constant the PDB seems to recommend GIMP-FOREGROUND-FILL
 results in an unbound variable error being displayed. Why does
 FOREGROUND-FILL work and GIMP-FOREGROUND-FILL fail? Is that a
 mistake in the PDB or should I just know to knock GIMP- off the
 front of the name?

You are supposed to know. The Procedure Browser and the API docs show
the C API. The Script-Fu API uses slightly different style.


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


Re: [Gimp-user] Script Problem

2005-02-22 Thread Sven Neumann
Hi,

Graham Smith [EMAIL PROTECTED] writes:

 I've got a bit of a problem with a script that I make fairly extensive
 use of to create buttons for websites. It started out life as a
 GIMP-1.1 script and I upgraded it to work with GIMP-2.0 but have
 recently upgraded again to GIMP-2.2. Unfortunately this has broken the
 script (right when I need it of curse) and I can't figure out what is
 wrong.

The main problem is that you didn't sent us the full script and due to
the bad indentation it's rather difficult to see the problem. You are
most probably calling gimp-edit-fill on a drawable that has not yet
been added to the image. This has always been wrong and won't work any
longer in GIMP 2.2. See also http://developer.gimp.org/faq.html#id2779034


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


[Gimp-user] Opening Geo-Tiff files in GIMP

2005-02-22 Thread scott s.
I'm a new user, trying out GIMP.  I have a requirement to edit some
files in geotiff format.  When I open the file, I get an alert dialog
about unrecognized tags (which is OK as long as the data in them are
preserved) but these files are in 8,8,8 color and when GIMP loads them,
they are in 8 bit greyscale.  So far I have been unsuccessful in
figuring out why the 3 layers aren't being preserved.
TIA
scott s.
.
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user