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:



> 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

Reply via email to