Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion rodan-main/code/rodan/jobs/column_split/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ColumnSplit(RodanTask):
{'name': 'Background Layer', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Music Notes Layer', 'minimum': 1, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Text Layer', 'minimum': 1, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'RGB Image', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgb+png']},
{'name': 'Layer 4', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Layer 5', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Layer 6', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
Expand All @@ -49,6 +50,7 @@ class ColumnSplit(RodanTask):
{'name': 'Background Layer', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Music Notes Layer', 'minimum': 1, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Text Layer', 'minimum': 1, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'RGB Image', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgb+png']},
{'name': 'All Layers', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Layer 5', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
{'name': 'Layer 6', 'minimum': 0, 'maximum': 1, 'resource_types': ['image/rgba+png']},
Expand Down Expand Up @@ -113,7 +115,8 @@ def run_my_task(self, inputs, settings, outputs):
layer = inputs[key][0]['resource_path']
img = cv.imread(layer,cv.IMREAD_UNCHANGED)
layer_stacked = get_stacked_image(img,ranges)
layers.append(img)
if key != 'RGB Image':
layers.append(img)
if key in outputs:
outfile = outputs[key][0]['resource_path']
cv.imwrite(outfile+".png",layer_stacked)
Expand Down
2 changes: 2 additions & 0 deletions rodan-main/code/rodan/jobs/column_split/column_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def get_split_ranges(img,splits):
return ranges

# takes ranges in x, and stacks them vertically
# works for both RGB and RGBA images by adding white pixels regardless of amt of channels -
# constant_values=255 pads with (255, 255, 255) for 3, (255, 255, 255, 255) for 4
def get_stacked_image(img,ranges):
chunks = []
max = 0
Expand Down