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. Meier"<lists@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxx >> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer >> _______________________________________________ Gimp-developer mailing list Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer