Skip to content

Commit

Permalink
changing file name convention
Browse files Browse the repository at this point in the history
  • Loading branch information
himynamesdave committed Jun 2, 2020
1 parent 9534e3f commit 4120c06
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ Nadir Patcher is the result.

Using the script is simple. Arguments can be provided in the following format:

` python nadir-patcher.py "[PANOROAMIC PHOTO FILE OR FOLDER PATH]" "[NADIR FILE PATH]" [PERCENTAGE SIZE]"`
`python nadir-patcher.py "[PANOROAMIC PHOTO FILE OR FOLDER PATH]" "[NADIR FILE PATH]" [PERCENTAGE SIZE] "[OUTPUT_FOLDER_PATH]"`

`[PERCENTAGE SIZE]` refers to the height of the nadir as a percentage of total image height. This must be specified as whole number between 1 (smallest) and 100 (covers entire image). Somewhere between 5% to 15% is what most other software tools use to generate a nadir.

![Nadir as percentage of panoramic image height](/example-nadir-percentage-of-pano.jpg)

The naming convention for outputted images is as follows: [ORIGINAL FILE NAME] _ nadir _ [PERCENTAGE SIZE OF NADIR] pc. [ORIGINAL FILE EXTENSION]. For example; MULTISHOT_9698_000001.jpg > MULTISHOT_9698_000001_nadir_12pc.jpg
The naming convention for outputted images is as follows: [ORIGINAL FILE NAME] _ [NADIR FILE NAME] _ [PERCENTAGE SIZE OF NADIR] pc. [ORIGINAL FILE EXTENSION]. For example; MULTISHOT_9698_000001.jpg > MULTISHOT_9698_000001_nadir_12pc.jpg

To help you get started here's some examples. You'll find the files used in the [`samples/`](/samples) directory of this repository.

**Take single panoramic image and add a nadir covering 12% of the image:**
**Take a single panoramic image and add a nadir covering 12% of the image:**

` python nadir-patcher.py "samples/input/MULTISHOT_9698_000001.jpg" "samples/input/my_custom_nadir.png" 12`
`python nadir-patcher.py "samples/input/MULTISHOT_9698_000001.jpg" "samples/input/my_custom_nadir.png" 12 "samples/output/`

**Take a directory of panoramic images and add a nadir covering 8% of every image in the directory:**

` python nadir-patcher.py "samples/input/" "samples/input/my_custom_nadir.png" 8`
`python nadir-patcher.py "samples/input/" "samples/input/my_custom_nadir.png" 8 samples/output/`

## Branding guidelines

Expand Down
18 changes: 15 additions & 3 deletions nadir-patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,26 @@
output1="nadir_patcher_temp\\temp_result1.png"
output2="nadir_patcher_temp\\temp_result2.png"
output3="nadir_patcher_temp\\temp_result3.png"
def main(argv):

def main(argv):

main_file = sys.argv[1]
overlay_file = sys.argv[2]
d_size = float(int(sys.argv[3])/100)
output = sys.argv[4]
print('staring...')

input_file_name=(os.path.splitext(os.path.basename(main_file))[0])
input_path_name, input_file_extension = os.path.splitext(main_file)

nadir_file_name=(os.path.splitext(os.path.basename(overlay_file))[0])
nadir_path_name, nadir_file_extension = os.path.splitext(overlay_file)
output_file=input_file_name+"_"+nadir_file_name+"_"+str(sys.argv[3])+"pc"+input_file_extension

#print(output_file)

#output = sys.argv[4]

output=sys.argv[4]+"\\"+output_file
print('starting...')
if not os.path.exists(folder_name):
os.makedirs(folder_name)

Expand Down

0 comments on commit 4120c06

Please sign in to comment.