Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Rolf Siegrist  
#1 Posted : Monday, July 23, 2012 4:47:41 AM(UTC)
Rolf Siegrist

Rank: Newbie

Groups:
Joined: 6/19/2012(UTC)
Posts: 3

Hi there.

First of all good work with the Graphics Mill library.

I have some problems i would like to have an answer to.

My Project is to render 2d images as fast as possible with changes to each of the frames with your library. (I need this functionality to make the same effect with the same lib on a bigger Snapshot Version of the image, so directx or other functionality is not an option)

I use Levels, Invert, Convert to Grayscale on 1920x1080 pixel images with Format32bppPArgb.

Is there any way to parallelize the Image functions like invert command? (Unsafe code is an option).
Found a Solution for that question ;)
http://www.aurigma.com/d...AccessingtoPixelData.htm


Can i set the image to GrayScale 32Bit compatible without to first make it 16bit grayscale and then convert it back to 32bit? (Pixelmanipulation?)

Will i gain performance speed if i use GDI instead of GDI+, i didnt found some of the functions i need in GDI.

Does Graphic Mill use the Parallel.For .net Command for pixel manipulations?

And the last question for now.
Can i use GPU Acceleration with Graphic Mill?

Plattform Windows .net Framework 3.5 WPF

Best regards

Edited by user Monday, July 23, 2012 10:05:54 PM(UTC)  | Reason: Not specified

Dmitry  
#2 Posted : Tuesday, July 24, 2012 6:11:20 AM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

The simplest way to launch the processing in parallel is to write a routine performing your chain of transformations (Levels -> Invert -> Convert to AGray32). Then you create a pool of worker threads (standard multithreading computing in .NET) and launch the routine in each of them. Each thread will process its own files not affecting the chain in other threads. We do not recommend dividing processing of a single image between multiple threads because it could lead to unexpected results.

Quote:
Can i set the image to GrayScale 32Bit compatible without to first make it 16bit grayscale and then convert it back to 32bit?

Sure, it should look like this: bitmap.ColorManagement.ConvertToContinuous(ColorSpace.GrayScale, true, true);

Quote:
Will i gain performance speed if i use GDI instead of GDI+, i didnt found some of the functions i need in GDI.

What exact operations do you use in GDI+? In general, it should work slower than the same operation in GM.

Quote:
Does Graphic Mill use the Parallel.For .net Command for pixel manipulations?

The code is optimized for CPU instruction sets but cannot apply the manipulations, you mentioned before, in parallel.

Quote:
Can i use GPU Acceleration with Graphic Mill?

No, GPU is not supported.

Edited by user Tuesday, July 24, 2012 6:13:44 AM(UTC)  | Reason: Not specified

Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
Rolf Siegrist  
#3 Posted : Tuesday, July 24, 2012 10:38:14 PM(UTC)
Rolf Siegrist

Rank: Newbie

Groups:
Joined: 6/19/2012(UTC)
Posts: 3

Hello Dmitry

Thank you for the answer.

Quote:
Dmitry wrote:
Hello The simplest way to launch the processing in parallel is to write a routine performing your chain of transformations (Levels -> Invert -> Convert to AGray32). Then you create a pool of worker threads (standard multithreading computing in .NET) and launch the routine in each of them. Each thread will process its own files not affecting the chain in other threads. We do not recommend dividing processing of a single image between multiple threads because it could lead to unexpected results.

Ok i understand, but i might do a pixel manipulation in Parallel.For (LINQ)? With Bitmap Lock and Unlock functionality? Or are there any restrictions you have in mind?
I guess it should work because its just an array of pixels if i process them in parallel or not shouldnt bother.


Quote:
Dmitry wrote:
Can i set the image to GrayScale 32Bit compatible without to first make it 16bit grayscale and then convert it back to 32bit?
Sure, it should look like this: bitmap.ColorManagement.ConvertToContinuous(ColorSpace.GrayScale, true, true);

That unfortunately not work as expected.
Code:
    
                Aurigma.GraphicsMill.Transforms.PixelFormatConverter p = new Aurigma.GraphicsMill.Transforms.PixelFormatConverter();
                p.DestinationPixelFormat = Aurigma.GraphicsMill.PixelFormat.Format8bppGrayScale;
                p.ApplyTransform(bitmap);
                p.WaitForCompletion();

                p.DestinationPixelFormat = Aurigma.GraphicsMill.PixelFormat.Format32bppRgb;
                p.ApplyTransform(bitmap);
                p.WaitForCompletion();

Works
Code:
bitmap.ColorManagement.ConvertToContinuous(ColorSpace.GrayScale, true, true);

Gives me a wrong result.
The Image not gets Grayscale it becomes Green... I attach an image of it.



Quote:
Quote:
Will i gain performance speed if i use GDI instead of GDI+, i didnt found some of the functions i need in GDI.

Dmitry wrote:
What exact operations do you use in GDI+? In general, it should work slower than the same operation in GM.

I need the Levels command in RealTime if that is possible. And the Histogram
Code:
                    //Do a Levels Command
                    Aurigma.GraphicsMill.Transforms.Levels _levels = new Levels(ChannelsToSelect(), HistogramMode.Sum);

                    _levels.MinimumLevel = Convert.ToSingle(MinimumValue) / 255.0F;
                    _levels.MaximumLevel = Convert.ToSingle(MaximumValue) / 255.0F;
                    _levels.Shadows = Convert.ToSingle(ShadowValue) / 255.0F;
                    _levels.Midtones = MidTonesValue;
                    _levels.Highlights = Convert.ToSingle(HighLightsValue) / 255.0F;
                    _levels.ApplyTransform(bitmap);
                    _levels.WaitForCompletion();

Code:

CurrentHistogram = bitmap.Statistics.GetSumHistogram(ChannelsToSelect());  



Quote:
Quote:
Does Graphic Mill use the Parallel.For .net Command for pixel manipulations?

Dmitry wrote:
The code is optimized for CPU instruction sets but cannot apply the manipulations, you mentioned before, in parallel.

Ok thank you.


Quote:
Quote:
Can i use GPU Acceleration with Graphic Mill?

Dmitry wrote:
No, GPU is not supported.

Ok Thank you, do you have any plans for GPU Acceleration in future?

Rolf Siegrist attached the following image(s):
working.jpg
notworking.jpg
orig.jpg
Dmitry  
#4 Posted : Monday, July 30, 2012 4:55:56 AM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Quote:
Ok i understand, but i might do a pixel manipulation in Parallel.For (LINQ)? With Bitmap Lock and Unlock functionality? Or are there any restrictions you have in mind?

I don’t see any reason why it should not work. Just make sure that routines don't affect each other.

Quote:
The Image not gets Grayscale it becomes Green... I attach an image of it.

Green??? There should be an error in the logic. Please send over a sample code illustrating the issue.

Quote:
I need the Levels command in RealTime if that is possible.

The Levels transform is rather slow operation. If you have user interface for this operation and want to show a preview to a user, consider applying the Levels on a thumbnail and after the user finishes selecting parameters, apply the transform on a source image.

Quote:
Ok Thank you, do you have any plans for GPU Acceleration in future?

No plans for GPU acceleration in the short term.

Edited by user Monday, July 30, 2012 5:08:22 AM(UTC)  | Reason: Not specified

Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
Rolf Siegrist  
#5 Posted : Sunday, August 5, 2012 9:36:13 PM(UTC)
Rolf Siegrist

Rank: Newbie

Groups:
Joined: 6/19/2012(UTC)
Posts: 3

Quote:
Quote:
The Image not gets Grayscale it becomes Green... I attach an image of it.

Green??? There should be an error in the logic. Please send over a sample code illustrating the issue.

The Problem is because i copy the pixel directly to the memory.
I need a Format32bppRgb image at the end. Seems your method converts the format as well? So the copy to memory seems to miss a Channel thats why it seems green.

Quote:
Quote:
I need the Levels command in RealTime if that is possible.

The Levels transform is rather slow operation. If you have user interface for this operation and want to show a preview to a user, consider applying the Levels on a thumbnail and after the user finishes selecting parameters, apply the transform on a source image.

Is a thumbnail enough accurate to calculate the histogram of the image?
I need to show a live image and the histogram that it is used with.

Sorry for the delay i was busy.

Dmitry  
#6 Posted : Monday, August 6, 2012 12:17:34 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Quote:
The Problem is because i copy the pixel directly to the memory.

It means something is wrong in your algorithm. If you send us the code we will try to help you troubleshoot the issue.

Quote:
Is a thumbnail enough accurate to calculate the histogram of the image?

I guess it's worth to give this approach a try. Keep in mind the larger thumbnail is, the more accurate histogram.

Edited by user Monday, August 6, 2012 12:19:12 PM(UTC)  | Reason: Not specified

Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.