From 3b117e674b62d7c0c70d2cb1b2dc3e70a32e48fb Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 7 Apr 2022 17:13:16 +0200 Subject: [PATCH] clarify that input with an alpha channel requires additional computation (closes: #142) --- README.md | 18 +++++++++--------- src/img2pdf.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3ccb5e2..362e832 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,15 @@ software, because the raw pixel data never has to be loaded into memory. The following table shows how img2pdf handles different input depending on the input file format and image color space. -| Format | Colorspace | Result | -| -------------------- | ------------------------------ | ------------- | -| JPEG | any | direct | -| JPEG2000 | any | direct | -| PNG (non-interlaced) | any | direct | -| TIFF (CCITT Group 4) | monochrome | direct | -| any | any except CMYK and monochrome | PNG Paeth | -| any | monochrome | CCITT Group 4 | -| any | CMYK | flate | +| Format | Colorspace | Result | +| ------------------------------------- | ------------------------------ | ------------- | +| JPEG | any | direct | +| JPEG2000 | any | direct | +| PNG (non-interlaced, no transparency) | any | direct | +| TIFF (CCITT Group 4) | monochrome | direct | +| any | any except CMYK and monochrome | PNG Paeth | +| any | monochrome | CCITT Group 4 | +| any | CMYK | flate | For JPEG, JPEG2000, non-interlaced PNG and TIFF images with CCITT Group 4 encoded data, img2pdf directly embeds the image data into the PDF without diff --git a/src/img2pdf.py b/src/img2pdf.py index b17f0c8..7bb2e2c 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -1823,8 +1823,8 @@ def read_images(rawdata, colorspace, first_frame_only=False, rot=None): smaskidat, _, _ = to_png_data(a) logger.warning( - "Image contains an alpha channel which will be stored " - "as a separate soft mask (/SMask) image in PDF." + "Image contains an alpha channel. Computing a separate " + "soft mask (/SMask) image to store transparency in PDF." ) elif color in [Colorspace.P, Colorspace.PA] and iccp is not None: # PDF does not support palette images with icc profile