For more information, refer to Applying Artistic Effects.
Puzzle Effect Function - Before
Puzzle Effect Function - After
View additional platform support for this Puzzle Effect function.
Run the PuzzleEffectCommand on an image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.SpecialEffects;
public void PuzzleEffectCommandExample()
{
// 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
PuzzleEffectCommand command = new PuzzleEffectCommand();
command.XBlock = 10;
command.YBlock = 10;
command.Randomize = 0;
command.Flags = PuzzleEffectCommandFlags.Border |
PuzzleEffectCommandFlags.Shuffle |
PuzzleEffectCommandFlags.Count |
PuzzleEffectCommandFlags.Resize;
command.BorderColor = new RasterColor(0, 0, 0);
// Apply Puzzle Effect to this image.
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:\LEADTOOLS23\Resources\Images";
}
Leadtools.ImageProcessing.SpecialEffects Namespace
Leadtools.ImageProcessing.Effects.MosaicCommand
Leadtools.ImageProcessing.Effects.PicturizeListCommand
Leadtools.ImageProcessing.Effects.PicturizeSingleCommand
Leadtools.ImageProcessing.Effects.CubismCommand
Leadtools.ImageProcessing.Effects.DisplacementCommand
Leadtools.ImageProcessing.Core.HalfTonePatternCommand
Leadtools.ImageProcessing.Effects.MaskConvolutionCommand