←Select platform

PlasmaCommand Class

Summary
Applies color patterns that blend into each other like plasma. This command is available in the Imaging Pro and above toolkits.
Syntax
C#
C++/CLI
Python
public class PlasmaCommand : RasterCommand 
public ref class PlasmaCommand : public RasterCommand   
class PlasmaCommand(RasterCommand): 
Remarks
  • As an example, suppose you call the PlasmaCommand method, using an Opacity value of 0, which means that no image is to be used, and you use the following settings:

    Parameters Value
    Shift 0
    Opacity 0
    Size 1000
    Flags Random1 | Rgb1

    The following figure results:

    plasmafilterbitmap.jpg
  • The Opacity value will always be considered to be 0, unless specified otherwise by a value between (and including) 0 to 100.

  • Use the RedFrequency, GreenFrequency, and BlueFrequency to create a custom color pattern. To use them, pass the CustomColor flag to PlasmaCommand. Otherwise, their values will be ignored.
  • The Hue value is a predefined color pattern that is based on the HLS color space. It creates plasma patterns by changing hue values.
  • The Rgb1 value is a predefined color pattern that is based on the RGB color space. Different combinations of red, green and blue frequencies produce different results.
  • Like the Rgb1 value, the Rgb2 value is based on the RGB color space, but uses a different combination of red, green and blue frequencies.
  • The color palette used for Shift is a continuous cylindrical color palette. In the following figures, one shows where on the palette a value of 0 lies, and the other one shows where on the palette the maximum value lies:

    ushift.jpg
  • This method supports 12-bit and 16-bit grayscale and 48-bit and 64-bit color images. Support for 12-bit and 16-bit grayscale and 48-bit and 64-bit color images is available only in the Document/Medical toolkits.

  • This method does not support signed data images.
  • This command does not support 32-bit grayscale images.

Plasma Function - Before

Plasma Function - Before

Plasma Function - After

Plasma Function - After

View additional platform support for this Plasma function.

Example

Run the PlasmaCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.SpecialEffects; 
 
 
public void PlasmaCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\Image2.jpg")); 
 
   // Prepare the command 
   PlasmaCommand command = new PlasmaCommand(); 
 
   // Draw crossed plasma colors of size 10 over the current image, use Rgb1 predefined 
   // color pattern without any shifting, and blend the effect into the current image 
   // with opacity of 80% 
   command.Flags = PlasmaCommandFlags.Rgb1 | PlasmaCommandFlags.Cross; 
   command.Opacity = 80; 
   command.Size = 1000; 
   command.Shift = 0; 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.SpecialEffects Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.