<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Convert Colors > Image/Pixel-Color Operations |
MiniRobotLanguage (MRL)
ANA.Grey
Convert an Image-Register (IR) to Grey using a threshold
Intention
This command will convert the Content of an IR directly into an Grey Image. Changing the Second parameter will give you a lot of options.
Using a value of 0 for P2 will internally use the optimum value of 1.
This command can be used to prepare an IR for Patternsearch or other operations in special cases where we do not want to depend on colors.
1. Capture Screenshot of open Browser and convert it to Grey
You can do this with your own preferred window - just change the STW.
STW.ct|Chrome_WidgetWin_1|- Brave
ANA.Snap|0
ANA.Save|0|?path\Before.png
ANA.Grey|0|0
ANA.Save|0|?path\After.png
ENR.
Here you can see the picture before and after the operation.
2. Use Grey with higher Threshold
In this case the effect is hardly foreseable. Due to the internal logic you will get an artificial result.
STW.ct|Chrome_WidgetWin_1|- Brave
ANA.Snap|0
ANA.Save|0|?path\Before.png
' Left Picture
ANA.Grey|0|2
' Second Picture
ANA.Grey|0|10
' Third Picture
ANA.Grey|0|400
' Right Picture
ANA.Grey|0|1650
ANA.Save|0|?path\After.png
ENR.
3. Quickly remove a watermark from a b/w picture.
VAN.$$TIM=#time#
VAF.$$PIA=?exeloc\Igorslab.png
VAF.$$PIB=?exeloc\V1.png
ANA.Load|0|$$PIA
ANA.TriColor|0|&H90FFFF
ANA.bw|0|760
ANA.Show|0!
ANA.Save|0|$$PIB
ENR.
-> ->
Syntax
ANA.Grey[|P1][|P2]
Parameter Explanation
P1 - opt. Image-Register Number, if omitted, IR 0 will be used.
P2 - opt. Threshold-Number, if omitted,1 will be used. The higher, the finer structures will be created.
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
Example
'***********************************
' ANA.Grey-Sample
'***********************************
STW.ct|Chrome_WidgetWin_1|- Brave
ANA.Snap|0
ANA.Save|0|?path\Before.png
ANA.Grey|0|1
ANA.Save|0|?path\After.png
ENR.
Remarks
This command is optimized, it will process even large pictures in less then a second.
For a Window with size 1140x1410 i needed 336402 Ticks (Speedtable using DMP.1), this is 0.02 Seconds on my computer, as my system can process 16000000 Ticks in one second.
Limitations:
-
See also:
•