dlemstra / ImageMagick.FredsScripts.NET

Fred's ImageMagick Scripts for .NET
http://www.fmwconcepts.com/imagemagick/
Other
46 stars 11 forks source link

Buil error with latest ImageMagick.net #3

Closed Ilkhom-S closed 8 years ago

Ilkhom-S commented 8 years ago

Hi,

TextClear script has some error with latest image magick.net library.

dlemstra commented 8 years ago

Thanks for reporting this. I will take a look at it later this week.

dlemstra commented 8 years ago

Can you clarify what the error is? I am not getting a build error when I upgrade Magick.NET in the package. I am getting errors with some of the unit tests though. And I will have to take a look at that.

Ilkhom-S commented 8 years ago

In textcleaner script. This function private void RemoveNoise(MagickImage image) { using (MagickImage second = image.Clone()) { second.ColorSpace = ColorSpace.Gray; second.Negate(); second.AdaptiveThreshold(FilterSize, FilterSize, FilterOffset); second.ContrastStretch((Percentage)0);

    if (SmoothingThreshold != null)
    {
      second.Blur(SmoothingThreshold.Value.ToDouble() / 100, Quantum.Max);
      second.Level(SmoothingThreshold.Value, new Percentage(100));
    }

    image.Composite(second, CompositeOperator.CopyAlpha);
  }

  image.Opaque(MagickColor.Transparent, BackgroundColor);
  image.Alpha(AlphaOption.Off);
}

this line : image.Opaque(MagickColor.Transparent, BackgroundColor);

dlemstra commented 8 years ago

It looks like you are not using the most recent version of that script: https://github.com/dlemstra/FredsImageMagickScripts.NET/blob/cf492cebbb630d54aa37bac0ed122d101331885d/FredsImageMagickScripts.NET/Threshold/TextCleaner/TextCleanerScript.cs. Your code is different from what I am seeing there.

Ilkhom-S commented 8 years ago

Sorry. I downloaded via link you provided. Links are old.

I will fork and take from there

Thanks