RSS/Atom feed Twitter
Site is read-only, email is disabled

replacing color

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

13 of 13 messages available
Toggle history

Please log in to manage your subscriptions.

Scheme question Steve Crane 16 Oct 01:00
  Scheme question Joao S. O. Bueno Calligaris 18 Oct 14:11
   Scheme question Jonathan Bartlett 20 Oct 20:44
    Scheme question Joao S. O. Bueno Calligaris 20 Oct 21:12
  Scheme question Jeff Trefftzs 18 Oct 20:23
   replacing color Tom 21 Oct 19:51
    replacing color Andrea Sozzi 21 Oct 19:05
    replacing color Carol Spears 21 Oct 20:05
Scheme question G.DeSercey@bton.ac.uk 18 Oct 17:45
  Scheme question Joao S. O. Bueno Calligaris 19 Oct 02:57
   Scheme question Nonexistent Entity 19 Oct 12:26
    Scheme question Joao S. O. Bueno Calligaris 19 Oct 14:32
     Scheme question Michael Schumacher 20 Oct 11:57
Steve Crane
2004-10-16 01:00:58 UTC (over 19 years ago)

Scheme question

I have been trying to write some scripts to automate tasks but find that I have some trouble using scheme. Although I am experienced in other languages I find scheme quite difficult to master as I can't seem to find any language references. There are lots of tutorials and samples showing how to create scripts but nothing that I could find that actually describes the language, functions available, etc.

At the moment I am trying to work out how to do integer division. I want to draw guides mapping the rule of thirds and want to ensure that I get an integer result when I divide the image height and width by 3. How would I do this?

Thanks
--
Steve Crane
http://craniac.afraid.org

Joao S. O. Bueno Calligaris
2004-10-18 14:11:40 UTC (over 19 years ago)

Scheme question

Hi!

I could not agree more withh what ylu have to say aboyut scheme.

Might I suggest that you'd use gimp-python for your scripts? As of gimp-2.0, gimp-python is in the main gimp-tree and can be installed as a separate package in major linux distributions.

To compile the GIMP with it, pass "--enable-python" to gimp ./configure

Regards,

JS ->

On Friday 15 October 2004 20:00, Steve Crane wrote:

I have been trying to write some scripts to automate tasks but find that I have some trouble using scheme. Although I am experienced in other languages I find scheme quite difficult to master as I can't seem to find any language references. There are lots of tutorials and samples showing how to create scripts but nothing that I could find that actually describes the language, functions available, etc.

At the moment I am trying to work out how to do integer division. I want to draw guides mapping the rule of thirds and want to ensure that I get an integer result when I divide the image height and width by 3. How would I do this?

Thanks --
Steve Crane
http://craniac.afraid.org

G.DeSercey@bton.ac.uk
2004-10-18 17:45:35 UTC (over 19 years ago)

Scheme question

-----Original Message-----
From: gimp-user-bounces@lists.xcf.berkeley.edu [mailto:gimp-user-bounces@lists.xcf.berkeley.edu] On Behalf Of Steve Crane
Sent: 16 October 2004 00:01
To: gimp-user@lists.xcf.berkeley.edu Subject: [Gimp-user] Scheme question

At the moment I am trying to work out how to do integer division. I want to draw guides mapping the rule of thirds and want to ensure that I get an integer result when I divide the image height and width by 3.
How would I do this?

Thanks
--

There is no internal function to convert to integer, but the following will do it:
(define (floor x) (- x (fmod x 1)))

Jeff Trefftzs
2004-10-18 20:23:26 UTC (over 19 years ago)

Scheme question

On Fri, 2004-10-15 at 16:00, Steve Crane wrote:

I have been trying to write some scripts to automate tasks but find that I have some trouble using scheme. Although I am experienced in other languages I find scheme quite difficult to master as I can't seem to find any language references. There are lots of tutorials and samples showing how to create scripts but nothing that I could find that actually describes the language, functions available, etc.

http://www.cs.indiana.edu/scheme-repository/imp/siod.html

This document describes (well, mostly) the implementation of scheme used in the GIMP. I have found that with this doc and occasional reference to existing scripts I can write my own scripts with no problem.

HTH,

Joao S. O. Bueno Calligaris
2004-10-19 02:57:58 UTC (over 19 years ago)

Scheme question

On Monday 18 October 2004 13:45, G.DeSercey@bton.ac.uk wrote:

-----Original Message-----
From: gimp-user-bounces@lists.xcf.berkeley.edu [mailto:gimp-user-bounces@lists.xcf.berkeley.edu] On Behalf Of Steve Crane
Sent: 16 October 2004 00:01
To: gimp-user@lists.xcf.berkeley.edu Subject: [Gimp-user] Scheme question

At the moment I am trying to work out how to do integer division. I want to draw guides mapping the rule of thirds and want to ensure that I get an integer result when I divide the image height and width by 3.
How would I do this?

Thanks
--

There is no internal function to convert to integer, but the following will do it:
(define (floor x) (- x (fmod x 1)))

I may be pushing it too hard...may be going off topic. But I will insist on this subject. I'd like to see more people using gimp python.

Getting the integer part of a image width and height would be as complex as:
width_3 = image.width / 3
heigth_3 = image.height / 3

where "image" is an image object passed by ptyhon-fu to every python script that needs an image as a parameter. As both numbers on above opertaions are int, so is the result. Would one need the integer number of a division by 2.5:
width_25 = int (image.width / 2.5)

Regards,

JS ->

Nonexistent Entity
2004-10-19 12:26:12 UTC (over 19 years ago)

Scheme question

On Mon, 18 Oct 2004 22:57:58 -0200, Joao S. O. Bueno Calligaris wrote:

I may be pushing it too hard...may be going off topic. But I will insist on this subject. I'd like to see more people using gimp python.

Are there any plans to compile Gimp Python for Win32? I'd be happy to use it!

Joao S. O. Bueno Calligaris
2004-10-19 14:32:25 UTC (over 19 years ago)

Scheme question

On Tuesday 19 October 2004 08:26, Nonexistent Entity wrote:

On Mon, 18 Oct 2004 22:57:58 -0200, Joao S. O. Bueno Calligaris

wrote:

I may be pushing it too hard...may be going off topic. But I will insist on this subject. I'd like to see more people using gimp python.

Are there any plans to compile Gimp Python for Win32? I'd be happy to use it!

Oh gosh...
I forgot it doesn't run on Windows yet.

It must be because of fairly minor details...but I can not check for them simply because I have no windows.

I will try and contact someone who could check for it.

Regards,

JS ->

Michael Schumacher
2004-10-20 11:57:33 UTC (over 19 years ago)

Scheme question

Joao S. O. Bueno Calligaris wrote:

Are there any plans to compile Gimp Python for Win32? I'd be happy to use it!

Oh gosh...
I forgot it doesn't run on Windows yet.

It must be because of fairly minor details...but I can not check for them simply because I have no windows.

I will try and contact someone who could check for it.

In order to get Python plug-ins for GIMP on Win32, you need:

1. Python You can use ActviePython, probably the most common Python distribution for Win32: http://www.activestate.com/Products/ActivePython/

2. PyGTK The python binding to GTK+. Available as installers from http://www.pcpm.ucl.ac.be/~gustin/win32_ports/

3. PyGIMP itself Built using the distutils tools, which are part of Python (and not the current autotools build).

4. A fix for bug 98737 http://bugzilla.gnome.org/show_bug.cgi?id=98737 Basically, glib can't run scripts on win32 right now.

I did step 3 myself (the resulting setup.py is rather poor, though) and use a modification to gimp's plug-in handling code to get around step 4.

PyGTK can be built without problems if you have a build environment that allows ou to build GIMP, so it can probably serve as an example on how to create a proper PyGIMP distutils build.

HTH, Michael

Jonathan Bartlett
2004-10-20 20:44:15 UTC (over 19 years ago)

Scheme question

I have been trying to write some scripts to automate tasks but find that I have some trouble using scheme. Although I am experienced in other languages I find scheme quite difficult to master as I can't seem to find any language references. There are lots of tutorials and samples showing how to create scripts but nothing that I could find that actually describes the language, functions available, etc.

The big problem w/ Gimp's scheme is that they use a version that is not really respected by anyone and that's horribly out-of-date. I think they did that in the spirit of keeping things simple, but it's horribly backfired.

Scheme is one of the most ingenious languages around. I'll be describing some of its more interesting features this coming year in several IBM DeveloperWorks articles. Unfortunately, many of these features aren't available on GIMP's scheme.

For learning scheme as a language, some good books are:

Teach Yourself Scheme in Fixnum Days (available on the web somewhere) How to Design Programs
Simply Scheme

a more advanced introduction, which every serious programmer should read sometime in their life, is

Structure and Interpretation of Computer Programs

In addition, the scheme standard is only 50 pages, and is a pretty easy read. You can get it online at schemers.org or a hardcopy from my website at http://www.cafepress.com/bartlettpublish.9174125

Jon ----
Learn to program using Linux assembly language http://www.cafeshops.com/bartlettpublish.8640017

Joao S. O. Bueno Calligaris
2004-10-20 21:12:53 UTC (over 19 years ago)

Scheme question

On Wednesday 20 October 2004 16:44, Jonathan Bartlett wrote:

I have been trying to write some scripts to automate tasks but find that I have some trouble using scheme. Although I am experienced in other languages I find scheme quite difficult to master as I can't seem to find any language references. There are lots of tutorials and samples showing how to create scripts but nothing that I could find that actually describes the language, functions available, etc.

The big problem w/ Gimp's scheme is that they use a version that is not really respected by anyone and that's horribly out-of-date. I think they did that in the spirit of keeping things simple, but it's horribly backfired.

Scheme is one of the most ingenious languages around. I'll be describing some of its more interesting features this coming year in several IBM DeveloperWorks articles. Unfortunately, many of these features aren't available on GIMP's scheme.

For learning scheme as a language, some good books are:

Teach Yourself Scheme in Fixnum Days (available on the web somewhere) How to Design Programs
Simply Scheme

a more advanced introduction, which every serious programmer should read sometime in their life, is

Structure and Interpretation of Computer Programs

In addition, the scheme standard is only 50 pages, and is a pretty easy read. You can get it online at schemers.org or a hardcopy from my website at http://www.cafepress.com/bartlettpublish.9174125

The GIMP? Scheme is in the proccess of beying updated by another interpreter - the Tiny-fu extension by Kevin is doing that.

I do notknow if that is an up to date implementation, however. All I know is that it currently doesn't support multi-byte character encodings - i.e. UTF-8, just like GIMP's native script-fu.

Jon
----
Learn to program using Linux assembly language http://www.cafeshops.com/bartlettpublish.8640017

Andrea Sozzi
2004-10-21 19:05:15 UTC (over 19 years ago)

replacing color

I'm having a problem changing the color of text in a gif image.

[...]

I open the image and choose 'select by color' and click on the orange text and then select the 'replace with FG color' (purple) and the color gets replaced with gray.

Your gif image is indexed, so only a small number of colors are avaialable. Try to change mode to RGM (Image > Mode > RGB), replace the color and then convert it back to indexed (Image > Mode > Indexed).

andrea ---
www.g-cows.org

Tom
2004-10-21 19:51:17 UTC (over 19 years ago)

replacing color

Hi,

Question: (I'm using Gimp 2.0.4 on Suse Linux 8.2) I'm having a problem changing the color of text in a gif image. I have a set of buttons I'd like to use for my website and want to change the color of the text from orange to purple. In Gimp I set the foreground color to #bb00bb (purple). I open the image and choose 'select by color' and click on the orange text and then select the 'replace with FG color' (purple) and the color gets replaced with gray.
Does any one know why this happens? Am I doing it the wrong way?

Thanks for any help, Tom

Carol Spears
2004-10-21 20:05:40 UTC (over 19 years ago)

replacing color

On Thu, Oct 21, 2004 at 01:51:17PM -0400, Tom wrote:

Hi,

Question: (I'm using Gimp 2.0.4 on Suse Linux 8.2) I'm having a problem changing the color of text in a gif image. I have a set of buttons I'd like to use for my website and want to change the color of the text from orange to purple. In Gimp I set the foreground color to #bb00bb (purple). I open the image and choose 'select by color' and click on the orange text and then select the 'replace with FG color' (purple) and the color gets replaced with gray.
Does any one know why this happens? Am I doing it the wrong way?

what you are doing should work fine with the addition of one step. gif's are indexed images therefore limited to only 256 colors. if you Image -->Mode -->RGB first and then do what you were doing, everything should work fine. RGB is millions of colors.

carol