On Wed, Jun 30, 2021 at 3:02 PM Ulrike Fischer <[email protected]> wrote:
>
> I lost transparency in a png used in a pdf 2.0 document.
>
> It looks as if luatex decides if to use a /Smask by looking only at
> the minor version. So 1.4-1.9 work, 2.0-2.3 fail, 2.4 works again
>
>
> \pdfvariable compresslevel=0
> \pdfvariable objcompresslevel=0
> \pdfvariable majorversion =2
> \pdfvariable minorversion =0 % or 4
> \saveimageresource {transparent.png}
> \useimageresource\lastsavedimageresourceindex
> xxx
> \bye
>
> Result
>
> minor 0:
> << /Type /XObject /Subtype /Image /Width 50 /Height 50
> /BitsPerComponent 8 /ColorSpace /DeviceRGB /Length 7500 >>
>
> minor 4:
> << /Type /XObject /Subtype /Image /Width 50 /Height 50
> /BitsPerComponent 8 /ColorSpace /DeviceRGB /SMask 7 0 R /Length 7500
> >>
>
> transparent.png is an arbitrary image with transparency.
>
yes, we assume majorversion=1
490 /*tex alpha channel support */
491 if (pdf->minor_version < 4
492 && png_get_color_type(png_p, info_p) |
PNG_COLOR_MASK_ALPHA) {
493 png_set_strip_alpha(png_p);
494 png_copy = false;
495 }
What are the rules for png when majorversion=2 ?
--
luigi