03-30-2013 05:23 PM
I am using NI Vision Dev module 2012 SP1 with Visual Basic 2010 Express with good results so far. I can display 8 bit images using the ImageViewer and have no problem saving these displayed greyscale images as individual tiff files using following code :
'- Save raw image to tiff file
ImageFilename = "C:\temp\RawImage " & Format$(FramesAcquired, "0000") & ".Tif"
myTiffOptions.CompressionType = 0
myTiffOptions.PhotometricMode = PhotometricMode.BlackIsZero
myTiffOptions.RowsPerStrip = 1
.Image.WriteTiffFile(ImageFilename, myTiffOptions)
However, when I threshold and further process the image, the resultant saved TIFF file using the above code is the correct size but displays only black pixels, whereas the image displayed on the ImageViewer is correct and displays the processed binary image as expected.
I'm guessing that I need to use instead the expanded command that includes the palette specification. I therefore tried the following code:
'- Save processed image to tiff file
ImageFilename = "C:\temp\ProcessedImage " & Format$(FramesAcquired, "0000") & ".Tif"
myTiffOptions.CompressionType = 0
myTiffOptions.PhotometricMode = PhotometricMode.BlackIsZero
myTiffOptions.RowsPerStrip = 1
Dim myPalette AsNew NationalInstruments.Vision.WindowsForms.Palette
myPalette.Type = WindowsForms.PaletteType.Binary
.Image.WriteTiffFile(ImageFilename, myTiffOptions, myPalette)
However, this produces the same all black Tiff file
Hoping someone can help me save this binary image to Tiff file?
04-01-2013 05:17 PM
Hi philgo,
Are you using a third party program to open up the TIFF file after it has been saved? If so, what program?
04-01-2013 06:16 PM
I am using IrfanView, version 4.35 ( see website www.irfanview.com) .
The properties of the two Tiff files are shown in the attached file. This viewer has worked we other situations. Would you suggest using a different means to view file?
04-02-2013 05:25 PM
It might be useful to try another program and see if this is happening just in IrfanView or across the board. It could be good to open the file in something like Photoshop and see if the image is truly all black or if the contrast is just extremely low.
07-30-2013 12:24 AM
besides IrfanView, there are a lot of software support tiff formats and being able to read and open tiff files. check the .net imaging sdk here. it is simple and powerful.
11-26-2013 12:46 AM
Hi, I am learning about how to build Tiff viewers with the help of some manual tools which can be customized by users according to our own favors to help view and process tiff files these days. Do you have any ideas about it? Or any good suggestion? Thanks in advance.
Best regards,
Arron
11-26-2013 12:56 PM
Hi Aaron,
What is is about TIFF files you have questions about specifically? The format is fairly well specified in the wikipedia article. It also might be more beneficial for you to post specific questions in a new thread so people will see it.
-N
02-11-2014 10:06 PM
tiff file has its own specification when you are display file. by the way i really want to know which tiff software are you using to view and read tiff file.
go through wike for more information.