06-20-2019 12:57 PM
I need to alter single-page TIFF files that are generated by an upstream non-LV process and get consumed by a downstream non-LV process. I do not have access to or details of either the producer or consumer processes and so I am trying to save my modified version of the TIFF using the same conditions as the original. Does anyone have insight on how I can save the files as LZW-compressed? This is a short duration development-mode experiment where I might have to alter ~500 files <10 times so a slightly time consuming, inelegant (but automated) route is OK.
{Win7-64, LV 2015 Pro Dev SP1, Vision Dev Module 2015}
I ran AsTiffTagViewer on the files:
06-21-2019 02:28 AM - edited 06-21-2019 02:35 AM
LZW is traditionally not that well supported, as it is\was patented. I'd look for a .NET way if I really needed it. But if all you have is IMAQ functions, you'd have to work on building the entire TIFF yourself to begin with.
Is it required so save the output in the same format as the input?
Seems to me that as long as you can read the format, you can save in any tiff format you want.
EDIT: Obviously the IMAQ saved files are too big. I'd look for a .NET tiff solution to save the file. Maybe libtiff?
EDIT: Does it help at all if you change the image quality?
06-25-2019 04:37 PM - edited 06-25-2019 04:43 PM
The TIFF files are from a slicer. The downstream process is a 3D printer. The TIFF is the communication scheme for getting layer info from the slicer to the printer. As such, changing the image quality will probably affect the information transmitted to the printer. Truth be told, though, I don't know that to be true for sure.
I've asked my tech to try the IMAQ-saved large TIFF files to see if the printer's "file open" procedure detects the LZW-or-not condition and does what's appropriate. I've also manually re-saved some IMAQ-modifed files with LZW compression using GIMP and he'll try those as well.
In theory I could ask the software group for details about their processes but I was trying to do a quick test without starting a multi-person "what did you do when you coded this 5 years ago?" research project.
Thanks for your thoughts. I'll look into libtiff.
07-05-2019 01:09 PM
FWIW, here is the VI I'm using to do the image modification. I used IMAQ copy to try and "inherit" some of the TIFF tags from the original image.
07-08-2019 03:00 AM
Write out that Boolean logic.
Pretty sure it can be done easier and more efficiently.