mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
Add new implementation of gaussian blur.
Changed SharpenImage to use the new algorithm.
This commit is contained in:
parent
ce72acdd61
commit
2cd3e9cacd
3 changed files with 260 additions and 4 deletions
|
@ -9,6 +9,7 @@ import OperationError from "../errors/OperationError";
|
|||
import { isImage } from "../lib/FileType";
|
||||
import { toBase64 } from "../lib/Base64";
|
||||
import jimp from "jimp";
|
||||
import { gaussianBlur } from "../lib/ImageManipulation";
|
||||
|
||||
/**
|
||||
* Blur Image operation
|
||||
|
@ -64,12 +65,14 @@ class BlurImage extends Operation {
|
|||
try {
|
||||
switch (blurType){
|
||||
case "Fast":
|
||||
if (ENVIRONMENT_IS_WORKER())
|
||||
self.sendStatusMessage("Fast blurring image...");
|
||||
image.blur(blurAmount);
|
||||
break;
|
||||
case "Gaussian":
|
||||
if (ENVIRONMENT_IS_WORKER())
|
||||
self.sendStatusMessage("Gaussian blurring image. This may take a while...");
|
||||
image.gaussian(blurAmount);
|
||||
self.sendStatusMessage("Gaussian blurring image...");
|
||||
image = gaussianBlur(image, blurAmount);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue