josch commented on issue josch/img2pdf#115 2021-08-02 20:35:54 +00:00
Possibility to provide PIL.Image.Image objects as input?

But that would be a lossy operation.

Why? Consider I have a PIL image that was created from scratch, for instance. Where is the quality loss?

Because you were talking about a JPEG.…

josch commented on issue josch/img2pdf#115 2021-08-02 20:26:38 +00:00
Possibility to provide PIL.Image.Image objects as input?

I see. Maybe img2pdf could detect the format and convert to a byte stream only if necessary, like in the case of JPEG?

But that would be a lossy operation.

josch commented on issue josch/img2pdf#113 2021-08-02 20:13:40 +00:00
Add PyMuPDF engine

I think PyMuPDF even has its own means to add images to PDFs, so img2pdf would not be necessary anyway.

It…

josch commented on issue josch/img2pdf#113 2021-08-02 20:06:18 +00:00
Add PyMuPDF engine

I don't see how it can be possible to add mupdf as another engine option, because as far as I understand its API, one cannot control precisely the PDF objects. Instead PyMuPDF is a high-level library…

josch commented on issue josch/img2pdf#115 2021-08-02 20:04:14 +00:00
Possibility to provide PIL.Image.Image objects as input?

I don't see how this can be possible. Not all input images are read into a PIL object. JPEG images, for example, are copied into the PDF as they are and you cannot do that if you just give the PIL…

josch commented on issue josch/img2pdf#112 2021-08-02 20:02:29 +00:00
Support for JBIG2 images ~~/ streams~~

Yet another unqualified idea of mine: Maybe the format of bytes 11 to 27 could be used to identify jbig2 files?

No. Those contain the size and dpi and can thus be arbitrary integers.

josch commented on issue josch/mmdebstrap#9 2021-08-01 07:16:52 +00:00
Silent/confusing failure when /etc/subuid and/or /etc/subgid are empty

With which name and email can I attribute you in the git commit implementing the diff you posted?

josch commented on issue josch/mmdebstrap#9 2021-07-31 15:53:41 +00:00
Silent/confusing failure when /etc/subuid and/or /etc/subgid are empty

Uuuuh! Nice catch, thank you!

Also please feel free to file more bugs that you run into when running mmdebstrap on arch. Since I'm only running it on Debian, I'm quite certain this will not be the…

josch commented on issue josch/img2pdf#112 2021-07-30 20:01:40 +00:00
Support for JBIG2 images ~~/ streams~~

So now the only remaining piece we need is some way to identify the file as JBIG2. Any ideas?

Not exactly a creative or reliable idea, but perhaps just the file extensions .jb2 /…

josch commented on issue josch/img2pdf#112 2021-07-30 17:46:10 +00:00
Support for JBIG2 images ~~/ streams~~

I also just confirmed that lossless JBIG2 compresses some output better than CCITT4. I got some bilevel PDF from here:

https://www.jbig2dec.com/tests/index.html

Then converted 042.bmp to JBIG2…

josch commented on issue josch/img2pdf#112 2021-07-30 17:28:36 +00:00
Support for JBIG2 images ~~/ streams~~

it seems that indeed the PDF does not contain the header containing the crucial information that this is a JBIG2 file (the magic) and the image dimensions.

It seems that the JBIG2 stream…

josch commented on issue josch/img2pdf#112 2021-07-30 17:23:27 +00:00
Support for JBIG2 images ~~/ streams~~

I have just encountered an extreme example yesterday: https://www.e-periodica.ch/cntmng?pid=ens-001:1968:14::46

You could extract the images, then

  1. use img2pdf to produce a merged…
josch commented on issue josch/img2pdf#112 2021-07-30 15:08:32 +00:00
Support for JBIG2 images ~~/ streams~~

Okay, I obtained a PDF containing a JBIG2 encoded image. This is becoming more troublesome... Instead of just containing one blob per image, the PDF contains two blobs for each image. One is the…

josch commented on issue josch/img2pdf#112 2021-07-30 14:44:23 +00:00
Support for JBIG2 images ~~/ streams~~

If it's somehow possible then yes, img2pdf should support jbig2 as input. One major reason is the one you cite in your last message: we avoid useless encoding computations in the same way that we…

josch commented on issue josch/img2pdf#112 2021-07-30 05:36:24 +00:00
Support for JBIG2 images ~~/ streams~~

The next issue: with jbig2enc not being present in Linux distros and being encumbered by patents and no JBIG2 support in imagemagick or PIL, I cannot add any testcases for JBIG2 support to the…

josch commented on issue josch/img2pdf#112 2021-07-29 21:16:25 +00:00
Support for JBIG2 images ~~/ streams~~

Yes, looks like there should be a header and if that also contains the size of the image then that should be enough to support JBIG2 as input.

But there seems to be no JBIG2 encoder in the…

josch commented on issue josch/img2pdf#112 2021-07-29 20:44:03 +00:00
Support for JBIG2 images ~~/ streams~~

JBIG2 and CCITT are ways to encode bilevel image data but they are not "formats" in the same sense as JPEG or PNG in the sense that they have no header that identifies which kind of file it is, what…

josch commented on issue josch/img2pdf#112 2021-07-29 20:10:17 +00:00
Support for JBIG2 images ~~/ streams~~

Hi,

I want to understand the problem. What is a "jbig2 image"? Which software produces those? jbig2 is not an image format but a way to encode bilevel data. Why would converting a jbig2 stream by…

josch commented on pull request josch/img2pdf#106 2021-07-17 15:54:17 +00:00
Convert 8-bit PNG & GIF alpha channels to /SMasks in PDF

I love it. This will definitely be part of the next img2pdf release. I'll probably name it 0.5.0 because support for transparancey is a major new feature. Unfortunately, I spent most of my time these…

josch commented on pull request josch/img2pdf#110 2021-07-05 13:36:43 +00:00
src/img2pdf_test.py: do not test format descriptions

I'm not saying you are wrong and I'm not saying that I won't accept your pull request (thanks for preparing it!) -- but I first want to contact the imagemagick developers about this issue because the…