PhilterPaper / Perl-PDF-Builder

Extended version of the popular PDF::API2 Perl-based PDF library for creating, reading, and modifying PDF documents
https://www.catskilltech.com/FreeSW/product/PDF%2DBuilder/title/PDF%3A%3ABuilder/freeSW_full
Other
6 stars 7 forks source link

TIFF+Alpha #154

Closed carygravel closed 3 years ago

carygravel commented 3 years ago

Here's a new way of breaking the alpha code in TIFF:

magick convert -depth 1 -size 2x2 pattern:gray50 -scale 1000% -alpha on TIFF/alpha/2.tif

PhilterPaper commented 3 years ago

What is this supposed to produce? Windows PhotoViewer refuses to display it (says it's corrupted). Windows Photo and Windows Paint say it's an unsupported format, GIMP shows a 20x20 image with no content, just the checkerboard "transparent" background. ImageMagick IMDisplay shows a 2x2 checkerboard (4 squares).

I tried again with magick convert -depth 1 -size 20x20 pattern:gray50 -alpha on TIFF/alpha/3.tif. Again, Windows won't display it, and GIMP shows no content. IMDisplay shows a 20x20 B&W checkerboard.

I just want to make sure I understand what it's supposed to be, before I spend time running it through PDF::Builder.

P.S. AsTiffTagViewer shows exactly the same metadata (tags), although the raster data is different between the two files.

carygravel commented 3 years ago

As you say, it produces a 2x2 chessboard.

I was looking for smaller images IM could create on the fly to speed up the tests and that wouldn't create so much output when they fail.

I'm guessing the corruption in Builder is due to something like a requirement that the row length be a whole number of bytes.

carygravel commented 3 years ago

It looks as though at least some of the inversion problems might be specific to LZW:

magick convert -depth 1 -gravity center -pointsize 78 -size 1000x100 caption:\"A caption for the image\" -compress lzw out.tif
PhilterPaper commented 3 years ago

Do you mean LZW without alpha layer? So might this be one of those edge-case problems you mentioned with LZW-to-Flate compression messing up things? Your example with and without LZW displays fine with ImageMagick (although Windows Photo Viewer says they're both corrupt). PDF::Buillder shows the LZW-compressed inverted and no compression OK (black on white).

PhilterPaper commented 3 years ago

Current status: