Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

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

Image/Pixel-Color Operations

ANA.Brightness - Change Brightness in IR

Previous Top Next


MiniRobotLanguage (MRL)

 

ANA.Luminance

Change HSL-Luminance in an full Image-Register (IR)
 

ANA.Change_Luminance

Calculate new HSL-Luminance for a given Color-Value

 

 

Intention

 

This command will change the Luminance-Value (HLS-System) for a full Image Register.

Luminosity or Luminance is somehow the brightness or brilliance of a picture.

 

There are 2 Modes:

A) Set Luminance to a fixed value between 0 and 1000

B) Change Luminance by a given value between -1000 and 1000

Which mode is used, depends on P3, if P3 is 0 (absolute value to be set)  or 1 (add/remove Luminance).

This command will work on the full given IR.

 

To just calculate the new Luminance from a single Pixel, use the equivalent command

ANA.Change_Luminance|RGB-Color|Color-Value|0/1

 

 

1. Change Luminance in IR relativ to current value

In this case we do set P3 to 1. Therefore the command will change the Original luminance Value by adding or subtracting the given value P2..

 

VAF.$$PIA=?exeloc\Sara2.jpg

NEF.$$PIA

  MBX.No such file.

  ENR.

EIF.

ANA.Load|0|$$PIA

ANA.Show|0!

ANA.Lum|0|500|1

DMP.1

ANA.Show|0!

ENR.

 

 

Here is another Sample Picture.

clip0199       clip0214        

    Original Picture                                        ANA.Complement

 

clip0215

Luminance Calculations are fast and will be done mostly in less then 1 Second.

 

 

Here we are using the absolute Luiminance and therefore P3 is 0.

 

' Here we use P3

VAF.$$PIA=?exeloc\Sara2.jpg

NEF.$$PIA

  MBX.No such file.

  ENR.

EIF.

ANA.Load|0|$$PIA

ANA.Show|0!

ANA.Lum|0|250|0

DMP.1

ANA.Show|0!

ENR.

 

 

clip0199   clip0216

 

 

 

' Sample for 

' ANA.Change_Luminance

'

VAF.$$PIA=?exeloc\Sara2.jpg

NEF.$$PIA

  MBX.No such file.

  ENR.

EIF.

ANA.Load|0|$$PIA

ANA.Show|0!

ANA.GetRes|0|$$XRE|$$YRE|$$SIZ

FOR.$$LOX|0|($$XRE/3*2)|1.6

  PRT.Column: $$LOX/$$XRE

  FOR.$$LOY|0|($$YRE/3*2)|1.6

    ANA.getpixelcolor|0|$$LOX|$$LOY|$$PIB

    ANA.clu|$$PIB|650|0|$$PIC

    ANA.Setpixelcolor|0|$$LOX|$$LOY|$$PIC

  NEX.

NEX.

ANA.Show|0!

ENR.

 

 

 

clip0199   clip0217

 

 

 

Syntax

 

ANA.Luminance|P1|P2[|P3][|P4]

ANA.Lum|P1|P2[|P3][|P4]

 

Parameter Explanation

P1 - Source Image-Register Number, Source-IR, if omitted, IR 0 will be used.

  P2 - (number, -1000 to +1000) Luminance Value, positive values will increase the contrast, negative values will decrease the contrast.

 P3 - 0/1 Value. Setting P3 to 0 will limit P2 to 0-1000. In this case P2 will be added to the value of the Pixels in the IR. Setting P3 to 1 will set the limit P2 to 0-1000.        

 P4 - Destination Image-Register Number, if omitted, IR P1 will be used as destination IR.

 

The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".

 

 

ANA.Change_Luminance|P1|P2[|P3][|P4]

ANA.Clu|P1|P2[|P3][|P4]

 

Parameter Explanation

 

P1 - RGB-In Value, Example: &HF0AC45

  P2 - (number, -255 to +255) Brightness Value, positive values will increase the contrast, negative values will decrease the contrast.

 P3 - 0/1 Value. Setting P3 to 0 will limit P2 to 0-1000. In this case P2 will be added to the value of the Pixels in the IR. Setting P3 to 1 will set the limit P2 to 0-1000.

P4 - Destination Variable, if omitted TOS is used.

 

 

 

Example

 

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

' ANA.Luminance-Sample

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

VAF.$$PIA=?exeloc\Sara2.jpg

NEF.$$PIA

  MBX.No such file.

  ENR.

EIF.

ANA.Load|0|$$PIA

ANA.Show|0!

ANA.GetRes|0|$$XRE|$$YRE|$$SIZ

FOR.$$LOX|0|($$XRE/3*2)

  PRT.Column: $$LOX/$$XRE

  FOR.$$LOY|0|($$YRE/3*2)|3

    ANA.getpixelcolor|0|$$LOX|$$LOY|$$PIB

    ANA.clu|$$PIB|650|1|$$PIC

    ANA.clu|$$PIB|-650|1|$$PID

    ANA.Setpixelcolor|0|$$LOX|$$LOY|$$PID

    ANA.Setpixelcolor|0|$$LOX|($$LOY+1)|$$PIC

  NEX.

NEX.

ANA.Show|0!

ENR.

 

clip0199   clip0218  

 

 

Remarks

-

 

 

Limitations:

-

 

See also:

 

  ANA.Contrast

  ANA.Brightness