<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Logic-Operations > Image/Pixel-Color Operations |
MiniRobotLanguage (MRL)
ANA.Logic
Combine Image-Register (IR) Content with Logic Operations and with or without a Color-Mask
Intention
This command will combine the IR's using Logic like AND/OR etc. it will work on Bit-Level.
1. Logic with Source IR -A and B -> another IR
This Logic will distribute and then remove watermark artefacts using the ANA.Logic and the ANA.rct-Command.
' This Script is not intended for removing Copyright Artefacts
' yet i have nothing else at hand so i take it as an example
$$PAT=?path\Resized
$$FIA=$$PAT\BTC_1060.png
' We make a IR that is completely filled with the artefacts color
ANA.New|0|1060|1060
ANA.Fill|0|&H6f6d6e
ANA.Show|0!
' We load the Picture that contains the unwanted artefacts
ANA.Load|1|$$FIA
ANA.Show|1!
' We use the Logic Command to distribute the artefacts
ANA.Logic|2|1|0|A OR B
ANA.Show|2!
' Now we remove the artefacts using the "remove-color -with-Tolerance" Command.
ANA.rct|2|&H6f6d6f|10|0
ANA.rct|2|&H7f7d7f|10|0
ANA.Show|2!
ENR.
Picture 1 with grey artefacts, Picture 2 with distribution. Picture 3 - Artefacts mostly removed.
-> =
Making an Outline:
VAF.$$PIA=?exeloc\Pics\P3.jpg
NEF.$$PIA
MBX.No such file.
ENR.
EIF.
ANA.Load|0|$$PIA
ANA.Copy|0|1
ANA.bw|0|500
ANA.bw|1|100
ANA.Invert|0
ANA.Invert|1
GSB.Save|0
GSB.Save|1
ANA.Logic|2|0|1|A XOR NOT B
'ANA.Invert|2
GSB.Save|2
ENR.
'===========================================================
:Save
$$NUM=§§_01
RND.0|999999|$$RND
FMT.$$RND|000000
$$PAT=?exeloc\Pics\Save_$$RND.png
IEF.$$PAT
GTO.Save
EIF.
ANA.Save|$$NUM|$$PAT
ANA.Show|$$NUM!
RET.
'===========================================================
Syntax
ANA.Logic[|P1][|P2][|P3][|P4][|P5]
Parameter Explanation
P1 - opt. Destination Image-Register number, if omitted, IR 0 will be used.
P2 - opt. Source A Image-Register number, if omitted, IR P1+1 will be used.
P3 - opt Source B Image-Register number, if omitted, IR P2+1 will be used.
P4 - opt. Logical Operator: AND, OR, XOR, EQV, IMP, SIMP can be used. Like this:
ANA.Logic|0|1|2|A AND B|RGB
ANA.Logic|0|1|2|NOT A AND B|RG
ANA.Logic|0|1|2|A OR B NOT T|B
where A and B are the two Source-IR's and T is the Target IR
P5 - opt. Color Mask, can be any Combination of R G B, for example RG will allow Red and Green in the Result and Filter Blue
If omitted the default Mask is RGB.
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
Example
'***********************************
' ANA.Logic-Sample
' In this Sample we remove grey artefacts
' and save the result
'***********************************
$$PAT=?path\Resized
$$FIA=$$PAT\BTC_1060.png
ANA.New|0|1060|1060
ANA.Fill|0|&H6f6d6e
'ANA.Show|0!
ANA.Load|1|$$FIA
'ANA.Show|1!
ANA.Logic|2|1|0|A OR B
'ANA.Show|2!
ANA.rct|2|&H6f6d6f|10|0
ANA.rct|2|&H7f7d7f|10|0
ANA.Show|2!
ANA.Save|2|$$PAT\BTC_X_1060.png
ENR.
Remarks
-
Limitations:
-
See also:
•