Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6815 Discussions

8 bit image to Imaging.PixelFormat.Format32bppPArgb

gegnal
Beginner
1,086 Views

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

ippiSwapChannels_8u_C3C4R

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

THanks

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
1,086 Views

Hello,

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

Regards,
Vladimir

0 Kudos
gegnal
Beginner
1,086 Views

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.

0 Kudos
Reply