TIF IMAGE FILE SAVE with LZW MODE ON . . .
2018-11-14-110830
All --
Is there a way to control TIF IMAGE FILE COMPRESSION via CODE?
Background . . .
When saving a TIF IMAGE in IMAGE-PRO, there are three options for compression. They are:
- NONE
- LZW
- LZW AND DIFFERNENCING
I have a customer that saves their TIF IMAGES with LZW.
I have written an APP for them that needs to maintain their ORIGINAL TIFF (with LZW) IMAGE FILE but I would like to create a WORKING COPY TIFF (with LZW) IMAGE FILE.
It seems that when IMAGE-PRO saves a TIF IMAGE FILE, the COMPRESSION OPTION that is used is only controllable via the SAVE AS DIALOG BOX.
If CODE does a SAVE AS, the COMPRESSION OPTION that will be used is the last one that was used via the SAVE AS DIALOG BOX.
I have recorded saving TIF IMAGES using each COMPRESSION OPTION but no difference is shown in the RECORDED CODE.
So . . .
Is there a way to control TIF IMAGE FILE COMPRESSION via CODE?
Thanks.
-- Matt
0
Answers
-
Matt,
Here is a macro to do that:Public Function SaveLZWDiff() As SimpleScript SaveLZWDiff = New SimpleScript Dim image1 With Application.DocumentCommands.ActiveImage(SaveLZWDiff) .Run(image1) End With With Automate.ScriptingCommands.CodeCommand(SaveLZWDiff) If .Run() Then ' User Code Here Dim image As McImage = image1 image.File.Compression=MediaCy.IQL.IO.mcscCompression.mcscLZWDiff End If End With With Application.DocumentCommands.SaveAs(SaveLZWDiff) .Filename = ThisApplication.Path(mcPathType.mcptWritableImages) & "Test.tif" .Run(image1) End With End Function
0 -
And a shorter version:
Public Sub SaveLZWDiff2 With ThisApplication.ActiveImage .File.Compression=MediaCy.IQL.IO.mcscCompression.mcscLZWDiff .SaveAs(ThisApplication.Path(mcPathType.mcptWritableImages) & "Test.tif") End With End Sub
0 -
BTW, in both cases you will need a reference to MediaCy.IQL.IO.dll which is not there by default.
Pierre0 -
2018-11-16-094433Pierre --Thank you very much for this information. The size difference between the LZW TIF and the TIF is SIGNIFICANT so this customer will very much appreciate the LZW OPTION.-- Matt
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions