MAPIR Scripts
Search…
⌃K

Convert RAW+JPG to TIFF

Convert the Survey3 RAW+JPG pair of images into TIFF images
Please complete the SETUP GUIDE prior to running the below code
We are using an .exe program to copy image metadata (EXIF). For non-Windows users you may need to find another solution to copy image metadata.
  1. 2.
    Locate the project files to a known location path on your computer
  2. 3.
    Create empty working folders inFolder and outFolder (see photo below)
  3. 4.
    Using your cursor right-click on the .bat file in the project files. Select "Edit"
  4. 5.
    This should open the .bat file for editing in your text editing or IDE of choice
Working folder structure
The contents of the .bat follow this structure:
@echo on
This line forces the command window to show when running the script
call "C:\Users\MAPIR\Anaconda3\Scripts\activate.bat"
This line points to the activate.bat file in the Anaconda3 installation folder, so that the scripts use the Python3 version with the previously installed libraries. You chose the installation folder path when you installed Anaconda3, which should not change unless you change where Anaconda3 is installed.
python "ConvertSurvey3ToTiff.py" -parameters "input folder path" "output folder path"
This is the main script processing line, which we'll explain in more detail further down the page.
pause >nul
This line keeps the command window open after processing so you can see the processing log.
5. To run the script simply double-click or right-click and select Open on the .bat file.
A command window will pop up and provide feedback during the processing.
If you need to stop the processing you can press Ctrl+C and then answer the prompt with Y+Enter
The script is done processing when you see the final text DONE.

Main Script Processing Line Options

The main processing line is where you will make any changes prior to running the script.
Here is the processing line:
python "ConvertSurvey3ToTiff.py" -parameters "input folder path" "output folder path"
The blank spaces in the .bat file are very important. Notice the spaces between each argument in the main processing line. If the code format does not match our examples it will not process correctly.
The parameters are processing options you can choose to use as follows:
Parameter Name
Parameter Command
Explanation
White Balance
-wb
Applies a white balance to the images (if supported)
To apply a parameter it would look like:
python "ConvertSurvey3ToTiff.py" -wb "input folder path" "output folder path"
To apply multiple parameters it would look like:
python "ConvertSurvey3ToTiff.py" -wb -vig "input folder path" "output folder path"
If an image in your input folder does not support a parameter it will tell you in the processing log window.
The input and output folder paths need to contain the path to your input image folder and the location you want the processed images to be output to.
We typically create two local folders named "inFolder" and "outFolder". The inFolder is where you put the images you want to process and the outFolder will contain the processed images.
Here is an example of the input and output folder paths:
python "Convert_Survey3_RAW_to_Tiff.py" "%~dp0\inFolder" "%~dp0\outFolder"
And with a parameters applied:
python "ConvertSurvey3ToTiff.py" -wb "%~dp0\inFolder" "%~dp0\outFolder"
The images in the output folder will be saved to a subfolder named Processed_N, where N starts at 1 and counts up depending on if there are already other Processed folders located in the output folder or not. This is ideal so that you can output to the same location every time and it will not overwrite your previously processed images.
Here is an example of an entire .bat ready to be run:
@echo on
call "C:\Users\MAPIR\Anaconda3\Scripts\activate.bat"
python "Convert_Survey3_RAW_to_Tiff.py" "%~dp0\inFolder" "%~dp0\outFolder"
pause >nul
When ran this script will open a command window and begin processing the images in local folder inFolder and save the processed results to local folder outFolder. The images will be corrected for white balance if supported on the particular camera model.
Once you have made all the necessary changes to the .bat file you can save it to begin processing.

Running the Script

To run the script simply double-click or right-click and select Open on the .bat file.
A command window will pop up and provide feedback during the processing.
If you need to stop the processing you can press Ctrl+C and then answer the prompt with Y+Enter
The script is done processing when you see the final text DONE.