I have created a SCRIPT to add a Spot Channel to a PNG image using #python and export it to .
That’s a script that’s supposed to export to TIFF as its output, but it didn’t work as expected. It ended up far from what I hoped for, kind of like when you’re hoping for a Photoshop-level edit on a picture but get something completely different.
from PIL import Image
def create_spot_channel(image_path, alpha_threshold=128):
image = Image.open(image_path)
image = image.convert("RGBA")
pixels = image.load()
width, height = image.size
for y in range(height):
for x in range(width):
r, g, b, a = pixels[x, y]
if b == 255 and a > alpha_threshold:
pixels[x, y] = (0, 0, 255, a)
return image
image_path = "D:/spot test/tes.png"
spot_channel_image = create_spot_channel(image_path, alpha_threshold=128)
spot_channel_image.save("D:/spot test/spot_channel_output.tiff", "TIFF")
print("spotchanneladd")
[Bfr&aft][1]
[1]: https://i.sstatic.net/kgyXZCb8.jpg
Because I thought it was too complicated to use export (TIFF output), I tried to change the script to export to PDF for its output. I have tried many things, installing many libraries that support this. But I couldn’t achieve what I expected in the image. I use this script personally to manage my UV Printer, which requires the use of SpotChannel for its White ink ‘Print’.
Is there a solution? Or maybe another programming language reference that’s more compatible?