View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017542 | Scribus | General | public | 2025-05-30 06:04 | 2025-05-30 15:57 |
Reporter | ale | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Product Version | 1.7.1.svn | ||||
Summary | 0017542: Use image black and white or grayscale image as a mask in the PDF | ||||
Description | For comics, it is common to have black and white or grayscale images that are then used as a mask for specific colors in the print process. The image is inserted as is and an "imagemaks" field is defined in the pdf with the color to be used for the printing. Possible implementation: - Add an effect "Use as stencil" / "Use as mask" - Which offers a color as option - The image is then inserted in the PDF as an imagemask as a black and white image + the color in the "arguments" - As an example, the feature has been implemented in CapyiPDF. We can ask them for details | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
There are two different use cases for this functionality. I wrote a blog post about the comics one here: https://nibblestew.blogspot.com/2023/04/the-unbearable-tightness-of-printing.html The second one is about printing images with custom colors (usually spot colors). Suppose you have a 1-bit image of a line drawing with lots of crosshatching and other details. Now instead of plain black, you'd want to print this image using a specific spot ink. The only way to do this with Scribus currently is to convert the image to vectors and then fill that. This is both lossy and wasteful. Being able to use an image as an ink stencil would make this work easily and without any image quality losses. If the mask image is in grayscale rather than 1 bit, you can _also_ specify the amount of ink used. AFAIK this is not possible to do with any other approach. |
|
the "use as stencil" effect has to be the only effect selected! |
|
I have done this by hand with CapyPDF. The attached file contains the relevant Python bits to draw a 1-bit image with a custom Pantone ink. capyscript.py (957 bytes)
def create(infile, outfile): dprops = capypdf.DocumentProperties() pprops = capypdf.PageProperties() pprops.set_pagebox(capypdf.PageBox.Media, 0, 0, pagew, pageh) dprops.set_default_page_properties(pprops) with capypdf.Generator(outfile, dprops) as g: ipar = capypdf.ImagePdfProperties() ipar.set_mask(True) im = g.load_image(infile) image_id = g.add_image(im, ipar) f4 = capypdf.Type4Function([0, 1], [0, 1, 0, 1, 0, 1, 0, 1], function_code) f4id = g.add_function(f4) sepid = g.add_separation(ink_name, capypdf.DeviceColorspace.CMYK, f4id) brown = capypdf.Color() brown.set_separation(sepid, 1.0) with g.page_draw_context() as ctx: with ctx.push_gstate(): ctx.scale(pagew, pageh) ctx.set_nonstroke(brown) ctx.cmd_Do(image_id) |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-05-30 06:04 | ale | New Issue | |
2025-05-30 06:04 | ale | Relationship added | related to 0003743 |
2025-05-30 06:13 | ale | Relationship added | related to 0003746 |
2025-05-30 07:41 | ale | Relationship added | related to 0011059 |
2025-05-30 07:48 | ale | Relationship added | child of 0013013 |
2025-05-30 08:32 | JussiP | Note Added: 0052684 | |
2025-05-30 15:07 | ale | Note Added: 0052687 | |
2025-05-30 15:57 | JussiP | Note Added: 0052690 | |
2025-05-30 15:57 | JussiP | File Added: capyscript.py |