Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions signynts-darkroom-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,20 @@ def dust_removal(infrared_image, inverted_image, r_channel):

def signynts_darkroom_script(file_input):
layered, negative_input = cv2.imreadmulti(file_input, [], cv2.IMREAD_UNCHANGED)

if len(negative_input) == 3: # silverfast 9 images seem to have 3 layers
ir_silverfast_3l = True
ir_silverfast = False
ir_none = False
ir_vuescan = False

if len(negative_input) == 2: # silverfast images have 2 layers
ir_silverfast_3l = False
ir_silverfast = True
ir_none = False
ir_vuescan = False

elif len(negative_input) == 1: # vuescan images have 1 layer
ir_silverfast_3l = False
ir_silverfast = False
ir_vuescan = False
ir_none = True
Expand All @@ -184,12 +191,20 @@ def signynts_darkroom_script(file_input):
ir_vuescan = True
ir_none = False

if ir_silverfast:
if ir_silverfast_3l:
print(' Identified image as Silverfast scan')

inverted_image, r_channel = negative_inversion(negative_input[0])
dust_removed = dust_removal(negative_input[2], inverted_image, r_channel)
combined = np.dstack((inverted_image, dust_removed))

elif ir_silverfast:
print(' Identified image as Silverfast scan')

inverted_image, r_channel = negative_inversion(negative_input[0])
dust_removed = dust_removal(negative_input[1], inverted_image, r_channel)
combined = np.dstack((inverted_image, dust_removed))

elif ir_vuescan:
print(' Identified image as VueScan scan')

Expand Down