The following examples show the effect of a Despeckle filter
applied to a portion of detail from a picture of the Hubble Space
Telescope. The image is characterized by a relatively smooth
background but a complex foreground. The image is very grainy but
the grain is obscured in areas of high complexity and is only
really visible in the background.
void function() {
using (Doc doc = new Doc()) {
AddImagePage(doc, img4); // original image
doc.Rendering.Save("EffectDespeckle.jpg");
using (ImageLayer layer = AddImagePage(doc, img4)) {
using (EffectOperation effect = new EffectOperation("Despeckle")) {
effect.Parameters["Threshold"].Value = 10;
effect.Apply(layer.PixMap);
}
}
doc.Rendering.Save("EffectDespeckle10.jpg");
using (ImageLayer layer = AddImagePage(doc, img4)) {
using (EffectOperation effect = new EffectOperation("Despeckle")) {
effect.Parameters["Threshold"].Value = 20;
effect.Apply(layer.PixMap);
}
}
doc.Rendering.Save("EffectDespeckle20.jpg");
using (ImageLayer layer = AddImagePage(doc, img4)) {
using (EffectOperation effect = new EffectOperation("Despeckle")) {
effect.Parameters["Threshold"].Value = 30;
effect.Apply(layer.PixMap);
}
}
doc.Rendering.Save("EffectDespeckle30.jpg");
}
}