This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Friday, January 28, 2011 4:53:41 AM(UTC)
Groups: Registered
Posts: 4
Hello,
I need to combine a grayscale image with a 1-bpp image.
The combining should happen like this:
- a zero bit should leave the color in the grayscale bitmap unchanged. (transparent)
- a one bit should change the color in the grayscale bitmap to a given grayscale value.
thank you.
#2
Posted
:
Sunday, January 30, 2011 3:35:00 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
To do that using LEADTOOLS, here is one way:
1. A 1-bit image in LEADTOOLS always has a palette of 2 colors. They could be pure black and white, but they could also be any 2 other colors. Change the palette of the 1-bit image so that the first entry (index 0) is RGB(0,0,0) which is black, and the second entry (index 1) is the grayscale shade you want to use.
2. Convert the 1-bit image to 8-bit grayscale.
3. Define a region on the newly-converted image that has all the non-black pixels.
4. Perform a fast combine operation to copy the region area to the other bitmap.
The exact details depend on which LEADTOOLS version (16, 17, etc.) and programming interface (Main OCX, .NET classes, DLL API, C++ Classes, etc.) you are using.
#3
Posted
:
Sunday, January 30, 2011 10:47:06 PM(UTC)
Groups: Registered
Posts: 4
Thank you for the quick response.
I had already implemented it with the FeatherAlphaBlend function, but that was a bit slow. So I will try it in this way.
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.