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

McCann Retinex plugin with python

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.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

McCann Retinex plugin with python John Fremlin 15 Sep 10:48
  McCann Retinex plugin with python David Gowers 15 Sep 12:43
   McCann Retinex plugin with python John Fremlin 15 Sep 13:12
John Fremlin
2007-09-15 10:48:33 UTC (about 17 years ago)

McCann Retinex plugin with python

Yesterday I decided to implement the retinex algorithm described by John McCann in 1999 as a gimp plugin.

I am using Python (in particular numpy for the main calculations) and consequently chose to put in some modifications to the algorithm to make it more efficient, but it makes generally the same effect as that described in

Brian Funt, Florian Ciurea, and John McCann "Retinex in Matlab," Proceedings of the IS&T/SID Eighth Color Imaging Conference: Color Science, Systems and Applications, 2000, pp 112-121.

http://www.cs.sfu.ca/~colour/publications/IST-2000/index.html

As this is my first foray into gimp plugging in, I'd appreciate if someone could look over the code. Is there a more efficient way of getting out one colour channel of the image at a time? At the moment I read in the whole image which takes a lot of memory.

Searching the archives today I notice that Pedro Paf was suggesting implementing it as a Summer of Code project - as the algorithm is very simple (a day to make even starting no numpy or Gimp python knowledge), what enhancements where being contemplated?

David Gowers
2007-09-15 12:43:56 UTC (about 17 years ago)

McCann Retinex plugin with python

On 9/15/07, John Fremlin wrote:

Yesterday I decided to implement the retinex algorithm described by John McCann in 1999 as a gimp plugin.

I am using Python (in particular numpy for the main calculations) and consequently chose to put in some modifications to the algorithm to make it more efficient, but it makes generally the same effect as that described in

Brian Funt, Florian Ciurea, and John McCann "Retinex in Matlab," Proceedings of the IS&T/SID Eighth Color Imaging Conference: Color Science, Systems and Applications, 2000, pp 112-121.

http://www.cs.sfu.ca/~colour/publications/IST-2000/index.html

As this is my first foray into gimp plugging in, I'd appreciate if someone could look over the code. Is there a more efficient way of getting out one colour channel of the image at a time? At the moment I read in the whole image which takes a lot of memory.

plug_in_decompose decomposes the image into a layer per channel.

Searching the archives today I notice that Pedro Paf was suggesting implementing it as a Summer of Code project - as the algorithm is very simple (a day to make even starting no numpy or Gimp python knowledge), what enhancements where being contemplated?

I find this odd -- your whole email odd, in fact, because -- there is already a retinex plugin (found at Colours->Retinex; plug-ins/common/retinex.c in the GIMP source tree.). If you want to add some enhancements, perhaps you could check that out first.

John Fremlin
2007-09-15 13:12:28 UTC (about 17 years ago)

McCann Retinex plugin with python

"David Gowers" writes:
[...]

plug_in_decompose decomposes the image into a layer per channel.

Thanks

Searching the archives today I notice that Pedro Paf was suggesting implementing it as a Summer of Code project - as the algorithm is very simple (a day to make even starting no numpy or Gimp python knowledge), what enhancements where being contemplated?

I find this odd -- your whole email odd, in fact, because -- there is already a retinex plugin (found at Colours->Retinex; plug-ins/common/retinex.c in the GIMP source tree.). If you want to add some enhancements, perhaps you could check that out first.

The retinex plugin is not documented. (As far as I can see?) What do the different parameters to it mean? Even after looking at the paper it is supposedly based on (multsclrtx.ps) I don't understand the parameters. There are many different retinex algorithms based on widely different principles; it is true that this one and the McCann one are similar in some respects.

Obviously, I experimented with it a few times, but I couldn't get it to work before I gave up.

The objective of my implementation of is to brighten dark areas of the image while preserving detail, and it has a very noticeable effect.

Compare the outputs. Probably the best way to use my code is to select the non-flatten option and adjust the opacity of the retinex layer afterwards.