Jump to content

Saving Grayscale Image Refs as Pseudo Color Image Files


Recommended Posts

I'm acquiring 16-bit images and displaying them using the IMAQ display control. I allow the user to choose different lookup tables (LUTs) so that the grayscale image is displayed in pseudo color in the IMAQ display.

When the images are saved to disk they are saved in their native grayscale format. I'd like to give an option to save the images in display format as well. Has anyone ever done something like this before? I have an idea of how this could be done (by using the Interpolate 1D Array function and the LUT to convert each pixel to obtain values for each color), but this seems like a very slow way to do this since there may be 100s of images to convert.

Any ideas?

Thanks,

Bruce

Link to comment

Cast the image to RGB, using IMAQ Cast Image

use IMAQ ColorUserLookup to manipulate the pixels in the three planes as you want,

save the RGB buffer to file as a PNG.

Manipulating pixels by extracting out arrays will be slow. it is best to work with the canned IMAQ functions that don't extract data out into LabVIEW, but deal directly with the image buffer(s).

Neville.

Link to comment

Neville,

Thanks for the tip. I tried implementing what you suggested and it works really fast, but the IMAQ ColorUserLookup only works with 32bit color images (no support for 64bit color) which means the 16bit image is truncated to 8bits before the lookup table is applied making the conversion less accurate. I've included some test code if you want to take a look (the subVI "Convert Image Ref to IMAQ Display Color Image Ref.vi" has a conditional disable to select the 2 different code methods).

Any suggestions?

Thanks,

Bruce

Link to comment

QUOTE (Neville D @ May 13 2008, 12:28 PM)

Can you ignore the least significant bytes ?

Can you also upload a 64-bit image as well?

I'd prefer not to, but I guess I could make it an option. A conversion speed or quality option.

I'm not sure what 64-bit image you are asking for. A 64-bit RGB ramping image? With same value in each color? What will you try and do with it?

Thanks,

Bruce

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.