Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Extract logo from the images

$
0
0
You are only replacing colors that have the exact same color as the pixel at 1,2. If you want to get colors 'close' to that you need to set the ColorFuzz of the image. For this image setting it to 10% seems to be okay, not sure about other images though.
using (MagickImage image = new MagickImage("19045997.pcx"))
{
  using (PixelCollection p = image.GetReadOnlyPixels())
  {
    Pixel pp = p.GetPixel(1, 2);
    MagickColor c = pp.ToColor();
    MagickColor fill = new MagickColor(255, 255, 255);
    image.ColorFuzz = new Percentage(10);
    image.Opaque(c, fill);
    image.ClassType = ImageMagick.ClassType.Pseudo;

    image.Write("19045997.jpg");
  }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>