←Select platform

RomanMosaicCommand Class

Summary
Segments the image into rectangular or rounded rectangular tiles and fills them with a color chosen randomly from the colors of the tile's pixels. This method is available in the Imaging Pro and above toolkits.
Syntax
C#
C++/CLI
Python
public class RomanMosaicCommand : RasterCommand 
public ref class RomanMosaicCommand : public RasterCommand   
class RomanMosaicCommand(RasterCommand): 
Remarks
  • Use this method to divide the image into rectangular or rounded rectangular tiles and then fill each tile with a color chosen randomly from the colors of each tile's pixels.
  • This method can process the whole image or a region of the image. If the image has a region, the effect is applied only to the region.
  • 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.

Roman Mosaic Function - Before

Roman Mosaic Function - Before

Roman Mosaic Function - After

Roman Mosaic Function - After

View additional platform support for this Roman Mosaic function.

Example

Run the RomanMosaicCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.SpecialEffects; 
 
 
public void RomanMosiacCommandExample() 
{ 
   // 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 
   RomanMosaicCommand command = new RomanMosaicCommand(); 
   command.TileWidth = 15; 
   command.TileHeight = 15; 
   command.Border = 5; 
   command.ShadowAngle = ShadowCommandAngle.East; 
   command.ShadowThresh = 50; 
   command.Color = new RasterColor(0, 0, 0); 
   command.Flags = RomanMosaicCommandFlags.Rectangular | RomanMosaicCommandFlags.GrayShadow; 
 
   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.