Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Logic-Operations >

Image/Pixel-Color Operations

ANA.Insert

Previous Top Next


MiniRobotLanguage (MRL)

 

ANA.Insert

Insert a smaller Logo or Picture into a larger Picture

 

Intention

 

ANA.Insert takes P1 that contains the Target IR that is the larger Picture were we insert the smaller picture.
It will also need P4 that is te R wt the smaller picture that will be inserted at Coordinates P2,P3..

P5 - is an optional second Source that has to have the same size as P1.

In that case logical Operations can be done between P4 and P5.

P6 is the Command Part that describes the sort of Operation that should be done on the Target.

 

ANA.Insert has some 

 

Image Processing Features

This section describes the various image processing features available in our software. Each feature can be activated or configured using specific commands.

 

1.Logical Operations

1.1 Between Images A and B You can perform logical operations between two images, A and B.

Command

Description

A AND B

Performs a bitwise AND operation

A OR B

Performs a bitwise OR operation

A XOR B

Performs a bitwise XOR operation

Usage: "A AND B", "A OR B", or "A XOR B"

 

1.2 Between Result and Target After processing, you can perform a logical operation between the result and the target image.

 

Command

Description

RESULT AND TARGET

Performs a bitwise AND operation

RESULT OR TARGET

Performs a bitwise OR operation

RESULT XOR TARGET

Performs a bitwise XOR operation

Usage: "RESULT AND TARGET", "RESULT OR TARGET", or "RESULT XOR TARGET"

 

2.NOT Operations

You can invert (NOT) various elements of the process:

Command

Description

NOT A

Inverts image A

NOT B

Inverts image B

NOT TARGET

Inverts the target image

NOT RESULT

Inverts the result of the operation

Usage: Include any of these commands in your input string.

 

3.Pixel Skipping

You can choose to skip processing certain pixels:

Command

Description

SKIP BLACK

Skips processing of black pixels in image A

SKIP WHITE

Skips processing of white pixels in image A

Usage: Include "SKIP BLACK" or "SKIP WHITE" in your input string.

 

4.Blending

You can blend the result with the target image:

Command

Description

BLEND

Enables blending of the result with the target

ALPHA=xxx

Sets the alpha value for blending (0-1024)

Usage: "BLEND ALPHA=128" (for 50% blend)

 

5.Thresholding

Apply a threshold to convert the image to black and white:

Command: THRESHOLD=xxx Usage: "THRESHOLD=128" (sets threshold at 128, range 0-255)

 

6.Color Operations

Various color operations are available:

Command

Description

CHANNEL OPS

Enables operations on individual color channels, use

Skip Red, Skip  Green, Skip Blue (untested / May not work)

COLOR SHIFT

Applies a color shift to the result (untested / May not work)

GAMMA=xxx

Applies gamma correction (typically 0 to 255) (untested / May not work)

 

 

CONTRAST=xxxxx

Adjusts the contrast (range -32768 to 32767)   (untested / May not work)

Usage: Include these commands as needed, e.g., "GAMMA=1.5 CONTRAST=100"

 

7.Edge Detection and Blur

Apply edge detection or blur effects:

Command

Description

EDGE DETECT

Applies an edge detection algorithm

MARK

This Option will darken or lighten Parts that are otherwise not visible due to no difference to the background

Usage: Include "EDGE DETECT" or "BLUR" in your input string.

 

8.Special Operations

Command

Description

INVERT BLACK

Inverts the target where A is black

Usage: Include "INVERT BLACK" in your input string.

 

Added later:

A to BW

Using this, Source A will be converted to b/w before te process. This can be useful to avoid Antialiasing Artefacts.

As this is processed before the NOT A Option, you can still invert the result.

 

Use B on Fg

This Option will check if the Pixel is Foreground or Background and if its Foreground it will instead take the Color from "B" and place it in "A".

 

Use B on Bg

This Option will check if the Pixel is Foreground or Background and if its Background it will instead take the Color from "B" and place it in "A".

 

Combining Commands:

You can combine multiple commands in a single input string. Separate each command with spaces. For example:
 

A AND B NOT RESULT BLEND ALPHA=128 GAMMA=1.2 EDGE DETECT A to BW

This would perform an AND operation between A and B, invert the result, blend it with 50% opacity, apply gamma correction, and then apply edge detection.

 

Note:
The exact implementation and strength of each effect may depend on the specific algorithms used in the software.

 

ANA.Insert|6|$$TXP|$$TYP|2|7|A AND B Invert Black blend alpha=195 skip white result or target

ANA.Show|6!

 

clip1053clip1054

Methods to place Watermarks n Pictures using this command.

 

 

Syntax

 

 

ANA.Insert|P1|P2|P3|P4|P5[|P6]

 

Parameter Explanation

 

P1 - Destination Image-Register number, if omitted, IR 0 will be used.

P2 - X-Coordinate upper left corner were to insert the Picture from Source "A" (P4)

P3 - y-Coordinate upper left corner were to insert the Picture from Source "A" (P4)

P4 - Source A Image-Register number, typically a smaller Image then in P1

P5 - Source B Image-Register number of an Image that must have the same size as P1, use -1 to not use it.

P6 - opt. Logical Operator: See above.

 

 

 

 

Example

 

'***********************************

' ANA.-Sample

'***********************************

MOD.Enter|1

$$COP=?exeloc\Copyright\Copyright.png

' IR-0 Bild aus Clipboard

' IR-1 Bild mit Copyright in Schwarz

' IR-2 Resized Copyright-Image ($$TXB,$$TYB)

' IR-6 Target-Pcture

$$SIZ=24

NEF.$$COP

  MBX.Copyright-File not found.$crlf$$$COP

  END.  

EIF.

 

ANA.Load|1|$$COP

ANA.GetRes|1|$$XPB|$$YPB

ANA.From Clipboard|0

'$$SEL=?exeloc\Selene_Test.png

'ANA.Load|0|$$SEL

ANA.GetRes|0|$$XPA|$$YPA

 

CAL.$$TAH=$$YPA/$$SIZ|i

' Aspek-Ratio

CAL.$$ASR=$$XPB/$$YPB|i

CAL.$$TXB=$$TAH*$$ASR|i

VIN.$$TYB=$$TAH

ANA.Resize To|1|2|$$TXB|$$TYB

 

' Obere Linke Ecke wo das Bild hin soll.

CAL.$$PAD=$$YPA/$$SIZ

CAL.$$TXP=$$XPA-($$TXB+$$PAD)

CAL.$$TYP=$$YPA-($$TYB+$$PAD/8)

 

'DBP.Main Res: $$XPA,$$YPA

'DBP.ResC = $$XPB,$$YPB

'DBP.Place = $$TXB,$$TYB PAD: $$PAD

 

ANA.Invert|0|4

ANA.copy|0|6

'FOR.$$LJ5|1|1024|80

CAL.$$YPP=$$LJ5

ANA.Insert|6|$$TXP|$$TYP|2|4|Use B on Fg blend alpha=212 skip white 

'NEX.

ANA.To Clipboard|6

ANA.Show|6!

MOD.Leave

END.

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: