DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.76k stars 387 forks source link

Embedded image in .pdf file is black #608

Open phuchm opened 2 years ago

phuchm commented 2 years ago

Hi maintainer, I see the issue when I use the leptonica. The issue is: "Embedded image in .pdf file is black" Input image: BMP format with spp = 3, d = 32 and has color map (I'm so sorry because I can't provide this image) I used method: l_pixGenerateCIDataForPdf with L_FLATE_ENCODE Do you know this issue?

DanBloomberg commented 2 years ago

I am not aware of an issue. However, if you are using a 32-bit input bmp file, you will have seen this error message: "32 bpp rgba input data is not supported"

If you want this to be investigated, you need to provide both the code you used and an input image that shows the problem.

phuchm commented 2 years ago

Hi author, Oh, my image seems to be not RGBA because although d=32 but spp is only 3, not 4. So, I don't get message as you mentioned. I also see that in your code, you will remove Alpha channel if spp = 4. I only use Tesseract and export to pdf file. I think you just need to create a BMP image (.bmp) with d=32, spp=3, I think you can re-proceduce with Tesseract!