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.
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.
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);
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.
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.
Dmitry 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.
Dmitry 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.
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();
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.
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.
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.
Ok Thank you, do you have any plans for GPU Acceleration in future?
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.
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.