04-15-2009 04:32 PM
Hello:
I am trying to write a 16-bit tif file with the proper color table using Vision utility. I cannot get the proper color table. I can save as other formats but have special requests for 16-bit tif.
I have attached an example VI to show you this including a test color table and image. I have cross posted in the LabVIEW forum also. Any help is appreciated.
Sincerely,
Don
04-16-2009 12:07 PM
Hey DonRoth,
What version of LabVIEW are you using? Are you having trouble building the image or saving it as a TIFF? I put together a little routine to open and display an image. If I run your example and then run this example I am able to open up the image and view it. So it appears that your routine is saving the image fine.
Hope this helps, more information into the issue may be helpful.
-Ben
04-16-2009 12:40 PM
Hello - I am using 8.5 (LabVIEW and Vision) so you will need to save to 8.5 if you want me to run your example.
I am not sure what you don't understand regarding my post. Try running my code and look at the block diagram. After you run the code and save the .tif image, then open the .tif image with any third party software (nero, photoshop, snagit editor), it displays whites instead of reds. I need it to display the same color table as shown in the intensity graph and have created with the cluster that feeds into the IMAQ write tiff file fx.
Sincerely,
Don
04-16-2009 01:24 PM
04-17-2009 02:50 PM - edited 04-17-2009 02:51 PM
Hey Don,
I do see what you are referring to. In terms of getting your 8-bit images to save with the red, your very last bit in the color palette is 255/255/255 and I think you want it to be 255/0/0. If you change that entry to 255/0/0 the resulting 8-bit Tiff is a red and black image instead of the white and black image you were seeing before.
In terms of saving the image as a 16 bit tif, the color palette is only compatible with 8-bit images. The LabVIEW help lists the describe the color palette in the following manner:
"Color Palette indicates an array of clusters composed of 256 elements for each of the three color planes (red, green, and blue). A specific color is the result of applying a value between 0 and 255 for each of the three color planes. If the three planes have identical values, a gray level is obtained (0 specifies black and 255 specifies white)."
Since the color palette is a cluster of only 256 elements indicates that it works with 8-bit images.
Hope this helps
-Ben
04-18-2009 08:03 AM
Thanks. I think you are exactly right and I have to see why the last bit is not being written as 255, 0, 0.
However, you would think that the IMAQ routines would account internally for the 16-bit format and so once I get this fixed, I will try again and report back my results.
Sincerely,
Don
04-18-2009 08:24 AM
I am now formulating the color map correctly (I found out why I wasn't) - and I can save fine to the 8-bit formats. 16-bit IMAQ Write Tif still will not so I guess I have to stay with 8-bit IMAQ Write Tif. Again, I would have thought that IMAQ routines would have figured out a way to do this internally and I am surprised that NI has not updated this. There should be an explicit note on the HELP for the IMAQ Write Tif that discussed proper way to apply color table or that you cannot do so in the 16-bit case.
Thanks for looking at this. As always, another set of eyes is very helpful.
Sincerely,
Don