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 : Saturday, October 13, 2007 3:45:01 AM(UTC)
rick2018185

Groups: Registered
Posts: 21


Hi,

I'm using leadtools v13.

ColorSeparate method can separate the bitmap by color plane to produce one grayscale bitmap per plane. But  I want to remove the red color while keep the original palette. And I also want to save the removed part into a new bitmap just like only copy the red color from the original bitmap.

Is there any way to do this ?

Thanks

rick

 

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 : Tuesday, October 16, 2007 12:34:00 AM(UTC)

Qasem Lubani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


Please explain in more details what you're trying to do.


Do you want to identify pixels
that are in the red range of colors, or do you want to work with all pixels that have a red component?


For example, the color RGB(200,
10, 10) is in the Red range, although it's not pure red. On the other hand, the
color RGB(255, 250, 240) contains much more of the Red component, but it is not in the Red range at all.




Also, are you working with  images that have 8 bits per pixel or less? If
not, the images would not have palettes in LEADTOOLS. If you are working with
palettized images, is it a requirement that the original image's palette be completely preserved with no changes at all?




About removing the red color, what
exactly do you want to put in its place? Do you want to fill the affected parts with a certain color such as black?


I would also like to know which LEADTOOLS programming interface (OCX, .NET classes, DLL API, C++ Classes, etc.)

 
#3 Posted : Tuesday, October 16, 2007 5:40:32 PM(UTC)
rick2018185

Groups: Registered
Posts: 21


I think it should be the first way I want to deal with the bitmap (identify pixels those are in the red range of colors).

For example, as the images attached is concerned, I use method colorseparate(RGB) to process "original.bmp" , then I get red plane("ColorSep.bmp"). It looks like we "remove" the red color pixels from the bitmap.

Now I want to save the "removed" red pixels into a new bitmap. In another word, we need to create a new bitmap with same width and height against the original. Then we pick up the certain color (range) pixels from the original bitmap and fill them with the certain color in new bitmap.

There's nothing further need to be done with removed color in original bitmap.Method colorseparate works well. And It's not a requirement that the original image's palette should be completely preserved with no changes.

I use leadtools 13 main ocx and com. My dev tool is VB6.

 

Thanks

rick

 

File Attachment(s):
sample.rar (26kb) downloaded 19 time(s).
 
#4 Posted : Wednesday, October 17, 2007 3:57:22 AM(UTC)

Qasem Lubani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


You can use the following code:




 Dim io As New LEADRasterIO


   Dim proc As New LEADRasterProcess


   io.Load LEADRasterView1.Raster, "original.bmp", 0, 1, 1


   MsgBox 1


   LEADRasterView2.Raster.CreateBitmap
LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight, LEADRasterView1.Raster.BitmapBits


   proc.Fill LEADRasterView2.Raster, vbWhite


   LEADRasterView1.Raster.SetRgnColorHSVRange -25, 80, 90, 25, 255, 255, L_RGN_SET


   proc.Combine LEADRasterView2.Raster, 0, 0,
LEADRasterView1.Raster.BitmapWidth, LEADRasterView1.Raster.BitmapHeight, LEADRasterView1.Raster, 0, 0, CB_DST_0 + CB_OP_ADD


   proc.Fill LEADRasterView1.Raster, vbWhite

 
#5 Posted : Wednesday, October 17, 2007 4:27:56 PM(UTC)
rick2018185

Groups: Registered
Posts: 21


It works!

Thank you very much.

Rdgs,

rick

 
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-2020, Yet Another Forum.NET
This page was generated in 0.068 seconds.