Re: [Gimp-developer] Adding a layer mode

2011-03-03 Thread Jörn P. Meier
Hi Martin,

very cool. Is this a patch against the git version?

Cheers,

Jörn

On 03.03.2011 06:26, Martin Nordholts wrote:
 On 03/03/2011 02:00 AM, Jörn P. Meier wrote:
 Hi,

 I would like to implement the following layer mode in the GIMP:

 1) Transform destination and source pixels to HSL space.
 2) Note original destination pixel saturation.
 3) Set luminance component of destination pixel to luminance component
   of source pixel.
 4) Transform destination to HSV color space.
 5) Set saturation of destination pixel to original saturation of
   destination pixel.

 I'm assuming destination is also the result of the operation. Not sure
 how GIMP handles this, though.

 The purpose of the mode is to colorize a greyscale image while keeping
 both the saturation and hue data of the color layer and the luminance
 data of the greyscale image. Existing modes (as far as I see)
 unfortunately either mess up the color information or the luminance
 information.

 So, the question is, what changes would I need to make to add this
 layer mode?

 I would be very grateful for any hints. :)
 There is already a patch for that (using the CIELCH space instead), see
 the most recent patch in
 https://bugzilla.gnome.org/show_bug.cgi?id=325564

/ Martin



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


Re: [Gimp-developer] Adding a layer mode

2011-03-03 Thread Jörn P. Meier
Hi Joao,

thanks for the input!

Right now this would be only for me since my workflow somewhat depends 
on this mode.
I have already written an external implementation which is run from a 
script, but of course it would speed up things a lot if I had a realtime 
feedback on what the result will look like. :)

I might still take a look at the sources you mentioned. Maybe I'll learn 
something about how GIMP works. :)

Cheers,

Jörn

On 03.03.2011 03:14, Joao S. O. Bueno wrote:
 On Wed, Mar 2, 2011 at 10:00 PM, Jörn P. Meierli...@netgods.de  wrote:
 Hi,

 I would like to implement the following layer mode in the GIMP:

 1) Transform destination and source pixels to HSL space.
 2) Note original destination pixel saturation.
 3) Set luminance component of destination pixel to luminance component
 of source pixel.
 4) Transform destination to HSV color space.
 5) Set saturation of destination pixel to original saturation of
 destination pixel.

 I'm assuming destination is also the result of the operation. Not sure
 how GIMP handles this, though.

 The purpose of the mode is to colorize a greyscale image while keeping
 both the saturation and hue data of the color layer and the luminance
 data of the greyscale image. Existing modes (as far as I see)
 unfortunately either mess up the color information or the luminance
 information.

 Hi John ---

 regardless of the desired operation, it would be very difficult to
 stick a new layer operation in GIMP  -
 due to file compatibilities, and everything else.

 When I first started hacking around the GIMP source code, some years
 ago, new layer operations
 also where something that I messed with.

 But see..even if one doe shave a great idea, and a nice pacth taht
 wuld be included in the GIMP's source, there would be a problem of
 compatibility of new XCF images using the new layer mode, and older
 GIMP versions around.

 So, while, yes, you could create a new layer mode just to poke around,
 it would be of little use other than for yourself. (Regardless, it is
 fun enough, I suggest you try it). If you get a usefull enough result,
 maybe yu could make a plug-in that would combine two normal layers
 using the algorithm you describe. You loose all real time niceness,
 but at least you can achieve your result. (and this plug-in can be
 passed around to others).


 As for where to create a layer mode-- there are some files - -I don
 remember which now -- part of the fun is locating them -- you get to
 know yoru way around GIMP. You will even find out that there are
 different  code paths to render layers on the source tree. There are
 all the files on the app/composite directory -- or one can enable GEGL
 compositing, for which the files are under app/gegl

 This article can have some usefull hints on how to poke around GIMP' s source:
 http://www.ibm.com/developerworks/linux/library/os-gimp

 Regards,

 js
--


 So, the question is, what changes would I need to make to add this
 layer mode?

 I would be very grateful for any hints. :)

 Cheers,

 Jörn
 ___
 Gimp-developer mailing list
 Gimp-developer@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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


Re: [Gimp-developer] Adding a layer mode

2011-03-03 Thread Martin Nordholts
On 03/03/2011 06:03 PM, Jörn P. Meier wrote:
 very cool. Is this a patch against the git version?

Yes, and help with reviewing and testing it for inclusion in GIMP 2.8 
would be appreciated.

  / Martin


-- 

My GIMP Blog:
http://www.chromecode.com/
Why GIMP 2.8 is not released yet
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Adding a layer mode

2011-03-03 Thread Jörn P. Meier
Compiling worked, but after clicking around a bit I persistently get

(gimp-2.7:27459): Gimp-Display-CRITICAL **: 
gimp_display_shell_pointer_ungrab: assertion `shell-pointer_grabbed == 
TRUE' failed
gimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1

and that's it.

Cheers,

Jörn

On 03.03.2011 19:56, Martin Nordholts wrote:
 On 03/03/2011 06:03 PM, Jörn P. Meier wrote:
 very cool. Is this a patch against the git version?
 Yes, and help with reviewing and testing it for inclusion in GIMP 2.8
 would be appreciated.

/ Martin



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


[Gimp-developer] Adding a layer mode

2011-03-02 Thread Jörn P. Meier
Hi,

I would like to implement the following layer mode in the GIMP:

1) Transform destination and source pixels to HSL space.
2) Note original destination pixel saturation.
3) Set luminance component of destination pixel to luminance component
of source pixel.
4) Transform destination to HSV color space.
5) Set saturation of destination pixel to original saturation of
destination pixel.

I'm assuming destination is also the result of the operation. Not sure
how GIMP handles this, though.

The purpose of the mode is to colorize a greyscale image while keeping 
both the saturation and hue data of the color layer and the luminance
data of the greyscale image. Existing modes (as far as I see)
unfortunately either mess up the color information or the luminance
information.

So, the question is, what changes would I need to make to add this
layer mode?

I would be very grateful for any hints. :)

Cheers,

Jörn
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Adding a layer mode

2011-03-02 Thread Joao S. O. Bueno
On Wed, Mar 2, 2011 at 10:00 PM, Jörn P. Meier li...@netgods.de wrote:
 Hi,

 I would like to implement the following layer mode in the GIMP:

 1) Transform destination and source pixels to HSL space.
 2) Note original destination pixel saturation.
 3) Set luminance component of destination pixel to luminance component
    of source pixel.
 4) Transform destination to HSV color space.
 5) Set saturation of destination pixel to original saturation of
    destination pixel.

 I'm assuming destination is also the result of the operation. Not sure
 how GIMP handles this, though.

 The purpose of the mode is to colorize a greyscale image while keeping
 both the saturation and hue data of the color layer and the luminance
 data of the greyscale image. Existing modes (as far as I see)
 unfortunately either mess up the color information or the luminance
 information.


Hi John ---

regardless of the desired operation, it would be very difficult to
stick a new layer operation in GIMP  -
due to file compatibilities, and everything else.

When I first started hacking around the GIMP source code, some years
ago, new layer operations
also where something that I messed with.

But see..even if one doe shave a great idea, and a nice pacth taht
wuld be included in the GIMP's source, there would be a problem of
compatibility of new XCF images using the new layer mode, and older
GIMP versions around.

So, while, yes, you could create a new layer mode just to poke around,
it would be of little use other than for yourself. (Regardless, it is
fun enough, I suggest you try it). If you get a usefull enough result,
maybe yu could make a plug-in that would combine two normal layers
using the algorithm you describe. You loose all real time niceness,
but at least you can achieve your result. (and this plug-in can be
passed around to others).


As for where to create a layer mode-- there are some files - -I don
remember which now -- part of the fun is locating them -- you get to
know yoru way around GIMP. You will even find out that there are
different  code paths to render layers on the source tree. There are
all the files on the app/composite directory -- or one can enable GEGL
compositing, for which the files are under app/gegl

This article can have some usefull hints on how to poke around GIMP' s source:
http://www.ibm.com/developerworks/linux/library/os-gimp

Regards,

   js
  --



 So, the question is, what changes would I need to make to add this
 layer mode?

 I would be very grateful for any hints. :)

 Cheers,

 Jörn
 ___
 Gimp-developer mailing list
 Gimp-developer@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

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


Re: [Gimp-developer] Adding a layer mode

2011-03-02 Thread Martin Nordholts
On 03/03/2011 02:00 AM, Jörn P. Meier wrote:
 Hi,

 I would like to implement the following layer mode in the GIMP:

 1) Transform destination and source pixels to HSL space.
 2) Note original destination pixel saturation.
 3) Set luminance component of destination pixel to luminance component
  of source pixel.
 4) Transform destination to HSV color space.
 5) Set saturation of destination pixel to original saturation of
  destination pixel.

 I'm assuming destination is also the result of the operation. Not sure
 how GIMP handles this, though.

 The purpose of the mode is to colorize a greyscale image while keeping
 both the saturation and hue data of the color layer and the luminance
 data of the greyscale image. Existing modes (as far as I see)
 unfortunately either mess up the color information or the luminance
 information.

 So, the question is, what changes would I need to make to add this
 layer mode?

 I would be very grateful for any hints. :)

There is already a patch for that (using the CIELCH space instead), see 
the most recent patch in
https://bugzilla.gnome.org/show_bug.cgi?id=325564

  / Martin


-- 

My GIMP Blog:
http://www.chromecode.com/
Why GIMP 2.8 is not released yet
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer