Add "Hue (HSV)" to layer blend modes?

Here everybody can post his problems with PhotoLine
Benutzeravatar
Loadus
Mitglied
Beiträge: 47
Registriert: Do 27 Sep 2007 07:15

Add "Hue (HSV)" to layer blend modes?

Beitrag von Loadus »

Small request on my part (again!).

I work a lot with CGI stuff and editing pics that have gamma errors on them (mainly because they lack a proper ICC profile, scans etc.). I need to gamma compensate colors many times, but I'm finding it a bit difficult using Photoline. I've tried to work out how to separate the color information from the image without touching the luminance values. Here's my problem:

Bild

Please please implement a HSV mode (I'm not sure, but I think HSV separation can do it - the saturation is the same throughout the luminance?) "Color" or "Hue" ("Hue" might be better - saturation tends to alter the weights of the colors giving strange errors at lower levels) -blend to the layer blendmode -list. If you feel daring, add HSV mode to the Curves filter as well. I'll pay you one million million spacebucks for it. I promise.
Zuletzt geändert von Loadus am So 21 Feb 2010 06:35, insgesamt 1-mal geändert.
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Add "Color (HSV)" to layer blend modes?

Beitrag von bkh »

I am not quite sure what you did when you "blended over the original using Color". I suspect you created a copy of the original, adjusted the gamma of the copy and set the layer mode of the copied image to "color". This means that the color of the original image is modified according to the color information of the second image. Unfortunately, the PL manual does not give a precise definition. In any case, this is probably not what you want.

Instead, I'd recommend using "Curves..." (as a working/adjustment layer, if you like), either in RGB or HIS mode. It should be easy to adjsut the R, G and B curves to exactly match your target colors.

Alternatively, you can try the hue curve in HIS mode. Frankly, I don't think that HSV will solve your problem better than HSL (or HIS, as it is called in PL - there are too many names for those color spaces), at least as far as your example pic goes. In both color models, all the colors in your example pic have 100 % saturation and equal intensity (100 % in HSV, and 50 % in HSL). So the only parameter you can play with is the hue curve, and this will give the same results in both color spaces, since the definitions of hue are the same.

That said, curve adjustments in RGB, HSV and HSL are, of course, different when other colors are involved, and I certainly wouldn't mind having HSV (and LCh, for that matter) as possible color spaces in "Curves..." as well.

Cheers,

Burkhard.
Benutzeravatar
Loadus
Mitglied
Beiträge: 47
Registriert: Do 27 Sep 2007 07:15

Re: Add "Color (HSV)" to layer blend modes?

Beitrag von Loadus »

Hey Burkhard,

Yes, I've fiddled around with Curves - the hue adjustment can do a simulation of the effect, but it cores some tonality and worsens the quality. The blending can be done, it works in Paint Shop Pro X and (almost correctly in) GIMP. Copy the original to a layer, adjust gamma to 2.2 and blend with hue. Good tips, though. : )
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Add "Color (HSV)" to layer blend modes?

Beitrag von bkh »

Hi Loadus,

let me add that, if PL's blending modes are supposed to be similar to those in PhotoShop (the manual doesn't explicitly say so), then your example exhibits a bug in PL. In fact, since saturation and lightness in your example are constant, the second, third and fourth spectrum should be identical, regardless if blending mode is color or hue. Btw., I also tried with 16 bits color depth - same problem.

Cheers,

Burkhard.
Benutzeravatar
Loadus
Mitglied
Beiträge: 47
Registriert: Do 27 Sep 2007 07:15

Re: Add "Color (HSV)" to layer blend modes?

Beitrag von Loadus »

Actually, adding a "Define ..." layer blendmode would be awesome x 1000.
A simple dialog that has a freeform A + B = C calculation possibility like this:

Bild

Well there's a feature you don't see in a lot of places. Hardcore h4xx0r. :P
Martin Huber
Entwickler
Entwickler
Beiträge: 4298
Registriert: Di 19 Nov 2002 15:49

Re: Add "Color (HSV)" to layer blend modes?

Beitrag von Martin Huber »

bkh hat geschrieben:let me add that, if PL's blending modes are supposed to be similar to those in PhotoShop (the manual doesn't explicitly say so), then your example exhibits a bug in PL.
Why do you think so? I tried that example with (an old version 6) Photoshop, and the result was the same as in PhotoLine.
bkh hat geschrieben:In fact, since saturation and lightness in your example are constant,
The way lightness is defined for the blend modes, lightness is not constant. Therefore the blended result is partially darker.

Martin
Martin Huber
Entwickler
Entwickler
Beiträge: 4298
Registriert: Di 19 Nov 2002 15:49

Re: Add "Hue (HSV)" to layer blend modes?

Beitrag von Martin Huber »

You can copy the Hue channel by using "Tool/Change Channels". First copy the source-hue to the clipboard and then from the clipboard to the destination. But this only works well with layers having the same size.

Martin
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Add "Color (HSV)" to layer blend modes?

Beitrag von bkh »

Martin Huber hat geschrieben:
bkh hat geschrieben:let me add that, if PL's blending modes are supposed to be similar to those in PhotoShop (the manual doesn't explicitly say so), then your example exhibits a bug in PL.
Why do you think so? I tried that example with (an old version 6) Photoshop, and the result was the same as in PhotoLine.
bkh hat geschrieben:In fact, since saturation and lightness in your example are constant,
The way lightness is defined for the blend modes, lightness is not constant. Therefore the blended result is partially darker.

Martin
I see, luminance/lightness in that blend mode is not supposed to be the same as lightness as the "L" in HSL (since H and S seem to come from that definition, I expected L to belong to the same color model), and neither the L from CIE Lab, or the intensity from HIS (= HSL?) which Curves... uses.

I don't have a recent version of Photoshop available to try, but at least http://www.nathanm.com/photoshop-blending-math/ seems to indicate that it uses the plain HSL color model for blending. This may, of course, be wrong, but to me, this seems natural and sensible.

In any case, the luminance used in the blending has an enormous drop at pure blue, and a smaller drop at pure green. See the attached example file, which shows the luminance as used by the blending mode along with the L channel from CIE Lab, which PL apparently uses in its grey mixer (the L in HSL would just be 50 % grey). These drops (which do not reflect visual changes in luminance) seem to cause the rapid color changes in Loadus' example, and my guess would be that these are visible (and annoying) in many other instances as well. So, in my opinion, the luminance function used in blending mode is broken. Why not replace it by L in HSL (i.e., the average of max(R,G,B) and min(R,G,B)) or L as in CIE Lab (the latter might be too slow...).

Cheers

Burkhard.
Benutzeravatar
Loadus
Mitglied
Beiträge: 47
Registriert: Do 27 Sep 2007 07:15

Re: Add "Hue (HSV)" to layer blend modes?

Beitrag von Loadus »

Martin Huber hat geschrieben:You can copy the Hue channel by using "Tool/Change Channels"...
This does the trick better than the Hue blend in other software - thx for the tip! ^^
Martin Huber
Entwickler
Entwickler
Beiträge: 4298
Registriert: Di 19 Nov 2002 15:49

Re: Add "Color (HSV)" to layer blend modes?

Beitrag von Martin Huber »

bkh hat geschrieben:So, in my opinion, the luminance function used in blending mode is broken. Why not replace it by L in HSL (i.e., the average of max(R,G,B) and min(R,G,B)) or L as in CIE Lab (the latter might be too slow...).
Depending on the point of view the luminance of the blending functions may be considered broken, but our implementation has to be compatible with that of Photoshop and the current implementation should be very compatible.

In previous versions of PhotoLine the blending functions were based on HSL and this was a real problem, because PhotoLine's results were differing from Photoshop's and most people expected a compatible behaviour.

Martin
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Add "Hue (HSV)" to layer blend modes?

Beitrag von bkh »

If this is what PhotoShop really does (I don't have PhotoShop), then it makes sense to try to be compatible. Seems that the reference which I gave in my last posting is wrong about PhotoShop's math, then. Good to know that, alternatively,= one can copy and paste color channels to get more predictable results.

Cheers,

Burkhard.
Fransis
Mitglied
Beiträge: 1
Registriert: Mo 05 Sep 2011 08:36

Re: Add "Hue (HSV)" to layer blend modes?

Beitrag von Fransis »

As you become more advanced in CGI programming, it will become useful to understand more about what's happening behind the scenes. Specifically, how the browser and server communicate with one another. Because although it's all very well to write a program that prints "Hello, World.", it's not particularly useful. :D
Zuletzt geändert von Fransis am Fr 15 Jun 2012 13:35, insgesamt 2-mal geändert.
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Add "Hue (HSV)" to layer blend modes?

Beitrag von bkh »

Fransis hat geschrieben:As you become more advanced in CGI programming, it will become useful to understand more about what's happening behind the scenes. Specifically, how the browser and server communicate with one another. Because although it's all very well to write a program that prints "Hello, World.", it's not particularly useful. :D
I guess you are referring to CGI as in "Common gateway interface", but here the discussion is about computer generated imagery.

Cheers

Burkhard.
Safara
Mitglied
Beiträge: 4
Registriert: Di 27 Dez 2011 11:40

Re: Add "Hue (HSV)" to layer blend modes?

Beitrag von Safara »

Well, I would agree with BKH here since it is pretty much spot-on regarding the need for getting it compatible with Photoshop. Anyway, regarding adding hue to the layer blend models, I would suggest you copy the Hue channel. After all, this is very much practical and easy as when compared to going after other softwares.
"Happy New year 2012"