V 2.0.0 - Rasterix - histogram clean #2

This commit is contained in:
DESKTOP-TVBJISQ\Primere
2026-03-26 08:07:29 +01:00
parent 46294bb2c1
commit caf467ec69
+3 -3
View File
@@ -753,13 +753,13 @@ class PrimereHistogram:
"image": ("IMAGE", {"forceInput": True}),
"precision": ("BOOLEAN", {"default": False, "label_off": "8 bit", "label_on": "16 bit"}),
"show_histogram": ("BOOLEAN", {"default": False, "label_off": "Ignore histogram", "label_on": "Create histogram"}),
"histogram_source": ("BOOLEAN", {"default": False, "label_off": "Show output histogram", "label_on": "Show input histogram"}),
# "histogram_source": ("BOOLEAN", {"default": False, "label_off": "Show output histogram", "label_on": "Show input histogram"}),
"histogram_channel": (["RGB", "RED", "GREEN", "BLUE"], {"default": "RGB"}),
"histogram_style": (["bars", "lines", "waveform", "heatmap", "stacked", "luma", "parade"], {"default": "bars"}),
}
}
def primere_histogram(self, image, precision, show_histogram=False, histogram_source=False, histogram_channel="RGB", histogram_style="gradient"):
def primere_histogram(self, image, precision, show_histogram=False, histogram_channel="RGB", histogram_style="gradient"):
pil_img = utility.tensor_to_image(image)
pil_img_input = pil_img.copy()
@@ -767,7 +767,7 @@ class PrimereHistogram:
if show_histogram:
histogram.rasterix_hist_cache_store(pil_img_input, pil_img, precision)
active_hist = histogram.rasterix_hist_render_selected(pil_img_input, pil_img, precision, histogram_source, histogram_channel, histogram_style,)
active_hist = histogram.rasterix_hist_render_selected(pil_img_input, pil_img, precision, True, histogram_channel, histogram_style,)
suffix = ''.join(random.choice("abcdefghijklmnopqrstuvwxyz0123456789") for _ in range(8))
temp_file = f"rasterix_hist_{suffix}.png"
active_hist.save(os.path.join(folder_paths.temp_directory, temp_file), compress_level=1)