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 : Tuesday, June 16, 2009 10:16:05 AM(UTC)

jrgarr  
jrgarr

Groups: Registered
Posts: 2


Photoshop has a color pallet function that will take a grayscale image and map the pixel values to a color pallet consisting of black, red, and yellow.  Essentially blacks stay black, but as the pixel values get "brighter" they turn into red and finally yellow/almost-white.  Here is an example of it being used:  http://www.moesrealm.com/photoshop/flaming.html.

I am building an image processing application for x-ray images and our customer has required us to include this feature.  Starting with a grayscale RasterImage, can someone please suggest the process by which I could reproduce this effect in Leadtools?
 

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 : Wednesday, June 17, 2009 6:20:52 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

If the image is 8 bits per pixel or less, you can directly manipulate the palette entries to convert the gray shades to color.

For example, the following code converts gray shades to red shades:
===============================================
if (rasterImageViewer1.Image.BitsPerPixel > 8)
{
    MessageBox.Show("Palettes only exist in 8-bit or less images");
    return;
}
Leadtools.RasterColor[] p = rasterImageViewer1.Image.GetPalette();
for (int i = 0; i < p.Length; ++i)
    if (i < 128)
        p[i] = new RasterColor(i * 2, 0, 0);
    else
        p[i] = new RasterColor(255, (i - 128) * 2, (i - 128) * 2);
rasterImageViewer1.Image.SetPalette(p, 0, p.Length);
===============================================

You can choose a range of the palette to modify, and you can also use a different algorithm to do the mapping.

For other types of gray images (extended grayscale such as 12-bit and 16-bit), there is no palette, but there is a similar concept called lookup table and Window Leveling.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Thursday, September 30, 2010 10:32:14 PM(UTC)
Gunasekaran

Groups: Registered
Posts: 53


Hi Badwan

Can i get the range of other peletts like
1. blackbody(given by you)
2. Cardiac
3. Fiveramp
4. Flow
5. Fusion16
6. GE_Color
7. GrayRain
8. Hotiron
9. NIH
10. Spectrum
11. Slope.

Waiting for your reply.






 
#4 Posted : Saturday, October 2, 2010 11:13:08 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

You should be able to implement any algorithm you want for changing the palette entries. However, since I don't have the details of these algorithms, I'm afraid it will be up to you to do the implementation details for these algorithms.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.167 seconds.