Save image without saving metadata

Your place to discuss general handling of images and the CZI file format
Post Reply
user-5759
Posts: 6
Joined: Thu Jan 01, 1970 1:00 am

Save image without saving metadata

Post by user-5759 »

Hi,

Is there a way I can save a .tif and not have it save the .tif_metadata file as well?

I'm currently using:

Code: Select all

Zen.Application.Save(image,pathAndFileName)
Thank you,
Craig
user-5759
Posts: 6
Joined: Thu Jan 01, 1970 1:00 am

Post by user-5759 »

I've found the solution:

Code: Select all

        
# Save the image with no metadata
expSet=Zen.Processing.Utilities.Settings.SingleFileExportSetting(ZenExportFileType.TIFF)
expSet.CreateFolder = False ## Do not create new folder for each image
Zen.Processing.Utilities.ExportSingleFile(image,expSet,pathAndFileName) #Export image 
user-4
Posts: 398
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Hello Craig,

yes, saving the Image via export is the solution.

You can also do it via XML like

Code: Select all

image = Zen.Application.Documents.ActiveDocument

myXML = '''
<ProcessingParameters Function="SingleFileExport">
  <FunctionParameters Function="SingleFileExport">
    [B]<DestFolder>C:\\Users\\MyUser\\Pictures\\tmp</DestFolder>
[/B]    <SubsetSelectionMode>All</SubsetSelectionMode>
    <SubSetString></SubSetString>
    <MultichannelMode>ChannelComposite</MultichannelMode>
    <ProcessingModeFlags>WithDisplaySettings</ProcessingModeFlags>
    <MCSelectionMode>SubsetDefinition</MCSelectionMode>
    <UseChannelNames>false</UseChannelNames>
    <BurnInDataZone>false</BurnInDataZone>
    <ImageEncoderClsid>6b9e169f-8f55-404c-af09-771545a0aba8</ImageEncoderClsid>
    <ExportImageWriterOptions>
      <AllowFormatsOtherThanRGB24orGray8>false</AllowFormatsOtherThanRGB24orGray8>
      <TiffCompressionOption>Lzw</TiffCompressionOption>
    </ExportImageWriterOptions>
    <PanOption>All</PanOption>
    <TileMode>Retile</TileMode>
    <RetileSettings>
      <TileCountX>1</TileCountX>
      <TileCountY>1</TileCountY>
      <OverlapXPercent>0</OverlapXPercent>
      <OverlapYPercent>0</OverlapYPercent>
      <MaxTileCountX>500</MaxTileCountX>
      <MaxTileCountY>500</MaxTileCountY>
    </RetileSettings>
    <Zoom>1</Zoom>
   [B] <GenXMLFiles>false</GenXMLFiles>[/B]
    <CreateSubFolder>false</CreateSubFolder>
    <CreateZipArchive>false</CreateZipArchive>
   [B] <Prefix>myFileName</Prefix>[/B]
  </FunctionParameters>
</ProcessingParameters>
'''
Zen.Processing.Utilities.ExportSingleFile(image,myXML)
You can get the XML easily by right-click (and then select Copy) in the area, where the parameters of the export-function are set in the GUI.
Please note the double backslash in the DestFolder.
Post Reply