This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Converting Images to 1BppIndexed Ones

Hi,

i am converting an Image to an 1Bpp Indexed One
Aurigma.GraphicsMill.Bitmap theTiffImage = new Aurigma.GraphicsMill.Bitmap();
            theTiffImage.Unit = Aurigma.GraphicsMill.Unit.Mm;
            theTiffImage.HorizontalResolution = 300;
            theTiffImage.VerticalResolution = 300;
            theTiffImage.Create(80, 50, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);

...
certain Images will be drawn onto theTiffImage Bitmap
...
theTiffFile.ColorManagement.ConvertToIndexed(1, Aurigma.GraphicsMill.ColorPaletteType.GrayScale, new Aurigma.GraphicsMill.ColorPalette(theTiffFile, theTiffFile.HasAlpha));


This lasts very long!
Is there a way to fasten ist?

reagards

Christian
Hello Christian,

If you want to convert your RGB image to bicolor indexed image, you should not create bicolor palette for image (it always has two colors: black and white 🙂 ), it is rather time expensive operation. Your code takes 0.3 sec on my workstation. I have modified you code sample, now it takes about 0.1 sec:

Aurigma.GraphicsMill.Bitmap theTiffImage = new Aurigma.GraphicsMill.Bitmap();            
theTiffImage.Unit = Aurigma.GraphicsMill.Unit.Mm;            
theTiffImage.HorizontalResolution = 300;            
theTiffImage.VerticalResolution = 300;            
theTiffImage.Create(80, 50, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);
theTiffImage.ColorManagement.ConvertToIndexed(1, Aurigma.GraphicsMill.ColorPaletteType.Bicolor, null);
Hi Dmitry,

thx a lot! Your correction really improved my Application.

regards

Christian