Search found 6 matches

by SLS8
2020-03-20T11:23:41-07:00
Forum: Magick.NET
Topic: determine the number of unique image colors
Replies: 6
Views: 2112

Re: determine the number of unique image colors

For your photo .UniqueColors() returns 105330 colors which is also the number returned by .TotalColors. IM command line returns the same result of 105330 for -unique-colors anyway, if you want to have less unique colors and find which are those then use the dither suggestion img.Quantize(new Quantiz...
by SLS8
2020-03-09T05:25:53-07:00
Forum: Magick.NET
Topic: How to convert single color (not image) CMYK with ICC profile to rgb.
Replies: 4
Views: 2157

Re: How to convert single color (not image) CMYK with ICC profile to rgb.

The Colourful .net library does exactly that. But the suggested single pixel image is a fast way and you can add a Parallel.For loop too. The color result can be obtained by reading the pixel or with img.Histogram().First().Key; test this code with a known online converter, I may be wrong about magi...
by SLS8
2020-03-09T04:47:40-07:00
Forum: Magick.NET
Topic: Remove all horizontal and vertical lines from an image
Replies: 6
Views: 3497

Re: Remove all horizontal and vertical lines from an image

With morphology is a very imagemagicky way of doing it but with direct access to pixels I would just read the pixels from left to right in the middle of the height and see when it starts to be black(er) than white twice, start and end of the first vertical line. Then from the top to bottom to find t...
by SLS8
2020-03-04T03:18:51-07:00
Forum: Magick.NET
Topic: Multithreaded direct access sample
Replies: 0
Views: 2121

Multithreaded direct access sample

The previous samples on the forum were using functions that are no longer used so I made this test. I don't know if it's the fastest option, I'm still learning the Magick.NET api, but this works very fast. Single thread, multi function (per channel): public static MagickImage ChangePixels(MagickImag...
by SLS8
2020-03-03T12:57:41-07:00
Forum: Magick.NET
Topic: Faster processing sample
Replies: 2
Views: 1185

Re: Faster processing sample

I used the latest version 16bit x64 on nuget and my test on release build
by SLS8
2020-03-03T11:54:58-07:00
Forum: Magick.NET
Topic: Faster processing sample
Replies: 2
Views: 1185

Faster processing sample

Hi Reading the forum a noticed some questions about improving speed. Here's a solution that should work on images starting with about 4MP. The tile number should be adjusted for image size (smaller images don't need many threads, 2 is enough) and your hardware cpu threads. Stopwatch sw = new Stopwat...