8 bit image to Imaging.PixelFormat.Format32bppPArgb

8 bit image to Imaging.PixelFormat.Format32bppPArgb

I'd like to draw my 8 bit grayscale image quickly in a C# GUI. What's the best way to do this?

Currently, I'm doing this:

ippiDup_8u_C1C3R, followed by


It seems horribly inefficient, but apparently, GDI+ is optimized for Format32bppPArgb.


3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


why don't you use Format8bppIndexed pixel format for 8-bit images?


Apologies for the late reply.

I do use 8bpp images for processing and transport, but not for display. I'm trying to draw the bitmap in a C# GUI in combination with color markup using the Graphics.DrawImage command. If I try to draw the image it won't accept 8bpp (perhaps because there is already color markup on the graphics object). Random color seems to peek through in speckles.I find that converting to RGB (where r=g=b)solves the issue. After my post, I realized that 24bpp would work quite well, and the ippiDup_8u_C1C3R command is sufficient to get my image into 24bpp format. Still, it seems slow.

I saw a post about converting this at http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.languages.csharp/2006-03/msg00052.html. The poster suggests drawing the 8bpp image into a 32bpp image. This does not solve the issue; the colors are still showing through in speckles.

So, I guess this is not really an IPP issue, but thanks anyway for listening.

Leave a Comment

Please sign in to add a comment. Not a member? Join today