View Issue Details

IDProjectCategoryView StatusLast Update
0017542ScribusGeneralpublic2025-05-30 15:57
Reporterale Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version1.7.1.svn 
Summary0017542: Use image black and white or grayscale image as a mask in the PDF
DescriptionFor 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
TagsNo tags attached.
PatchNo

Relationships

related to 0003743 assignedfschmid Colorize converts Spot colors to CMYK 
related to 0003746 new Ability to assign spot to greyscale instead of black 
related to 0011059 new [PATCH] Fix overprinting for 1-bit images 
child of 0013013 new Metabug: Comics 

Activities

JussiP

2025-05-30 08:32

reporter   ~0052684

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.

ale

2025-05-30 15:07

manager   ~0052687

the "use as stencil" effect has to be the only effect selected!

JussiP

2025-05-30 15:57

reporter   ~0052690

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)
capyscript.py (957 bytes)   

Issue History

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