Parallel work - C#

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
eitanmiz
Posts: 8
Joined: 2018-11-12T15:06:01-07:00
Authentication code: 1152

Parallel work - C#

Post by eitanmiz »

Hello,

1.
How can I parallel work of MagickImage.Convolve(...) so it will work on several threads.
Can I control what behind the thread (i.e for first thread - i want to know which area is responsible by the thread, and even send this information to other processes).

2.
I need to load the image and quick translate it to rgb pixels (even the image file has only "R" and "G" value).

3.
As 2 - but create the image from the bitmap array.

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo »

IM will convolve images with OpenCL if you have that. Otherwise, it will multithread with OpenMP if you have that.

"magick -version" will say, under "Features:", whether you have OpenCL and OpenMP.

Sorry, I don't use Magick.NET or C#, and can't answer those questions.
snibgo's IM pages: im.snibgo.com
eitanmiz
Posts: 8
Joined: 2018-11-12T15:06:01-07:00
Authentication code: 1152

Re: Parallel work - C#

Post by eitanmiz »

Magick.NET-Q8-x64 ver 7.8.0.

I think it is OpenJP2.

I don't know how can I declare parallelism
(Maybe:
MagickImage mi = new MagickImage (...)
mi.Settings.<something> ? solve that issue)

i.e how many threads, and not doing this by myself (let imagemagick handle that).
For Convolve function - I need to control how many threads are running.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo »

OpenJP2 has no relevance to multi-threading.

If your implementation of IM has OpenMP, it will use multithreading. The command "magick -version" will tell you.

If you have multithreading, you can limit how many threads IM uses, eg "-limit thread 3" at the command line. But you can't force it to use a particular number of threads.
snibgo's IM pages: im.snibgo.com
eitanmiz
Posts: 8
Joined: 2018-11-12T15:06:01-07:00
Authentication code: 1152

Re: Parallel work - C#

Post by eitanmiz »

I don't understand.
I am new to magickImage.
In visual studio 2017, where can I write magick -version?

In package manager console I wrote:
magick -version

and got the exception:
magick : The term 'magick' is not recognized as the name of a cmdlet, function, ...

As I said, Magick.NET-Q8-x64 ver 7.8.0 (from nuget).

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo »

In a command window, at the command line, type the command "magick -version".
snibgo's IM pages: im.snibgo.com
eitanmiz
Posts: 8
Joined: 2018-11-12T15:06:01-07:00
Authentication code: 1152

Re: Parallel work - C#

Post by eitanmiz »

Same exception:
'magick' is not recognized as an internal or external command

I didn't do any magick installation outside visual studio - just installed it by visual studio 2017 -> manage nuget package.

This is forum for magick.net, so I persume that it's OK to post here. I am not using c++ directly.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo »

Okay, so you haven't installed ImageMagick binaries. Sorry, I can't help further.
snibgo's IM pages: im.snibgo.com
Post Reply