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 » 2018-11-13T07:54:13-07:00

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: 11829
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo » 2018-11-13T08:08:23-07:00

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 » 2018-11-14T01:35:22-07:00

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: 11829
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo » 2018-11-14T05:49:48-07:00

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 » 2018-11-14T06:47:21-07:00

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: 11829
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo » 2018-11-14T07:38:01-07:00

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 » 2018-11-14T08:15:25-07:00

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: 11829
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Parallel work - C#

Post by snibgo » 2018-11-14T11:15:41-07:00

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

Post Reply