Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, January 28, 2011 4:53:41 AM(UTC)

jules  
jules

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.

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, January 30, 2011 3:35:00 AM(UTC)

Adam Boulad  
Guest

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)

jules  
jules

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.059 seconds.