<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > RGB- and HLS-Operations > Image/Pixel-Color Operations |
MiniRobotLanguage (MRL)
ANA.RGB_HLS
ANA.HLS_RGB
Convert full Image-Register (IR) Content from R,G B to H,L,S and opposite direction
Intention
This command will convert the full Content of an given IR from R,G, B into H,L,S.
To just convert a SingleColor-Valur between HLS and RGB use other commands.
0-239 Hue is wavelength color.
0-240 Luminosity (brightness, brilliance) is black 0(0%) to white240(100%).
0-240 Saturation is relative bandwidth amount of grey in a color. 0(0%) to 240(100%)
as you can see, the Range from HLS is not exactly the same like it was RGB.
For further use.
RGB -> HLS
1. Generate Gradfients, mix these and convert the result to HLS
Here is the Source-Code:
ANA.New|0|800|400
ANA.vgradient|0|&HFF00FF|&H000000
ANA.New|2|800|400
ANA.hgradient|2|&H0000FF|&H00FFFF
ANA.Mix|0|2|7
ANA.Show|2!
ANA.RGB_HLS_IR|2|1
ANA.Show|1!
ANA.HLS_RGB_IR|2|3
DMP.1
ANA.Show|3!
ENR.
Picture 1: Original in IR 2 Picture 2 in IR 1 Picture 3 in IR 3
->+
Syntax
ANA.RGB_HLS_IR|P1[|P2]
ANA.HLS_RGB_IR|P1[|P2]
Parameter Explanation
P1 - opt. Source Image-Register number, if omitted, IR 0 will be used.
P2 - opt.Destination IR Image-Register number, if omitted, IR P1 will be used.
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
Example
-
Remarks
ANA.HLS_RGB_IR is much slower then the ANA.RGB_HLS_IR.
Anyway, both of these should do their work in at most some seconds.
In this example the slowest time is 21 Seconds.
At a resolution of 5100x3400 this is the Speed-Dump:
Limitations:
I have tested the Script up to a resolution of 10200x6800 and it will work, however the Debug-Window can not display such a large resolution (because your Screeen may not have such a size) therefore you need to use the Parameter "#" for the ANA.Show Command. Anything else works fine, and you can also save the resulting pictures.
See also:
•