SkiaSharp icon indicating copy to clipboard operation
SkiaSharp copied to clipboard

[FEATURE] PDF respect 1bpp size (smaller output size)

Open wstaelens opened this issue 1 year ago • 0 comments

Is your feature request related to a problem?

Everything works right now but only the file size of a pdf generated by SkiaSharp is too big, because 1bpp images are saved as 24bpp images.

Describe the solution you would like

Situation: A pdf file (scanned document) contains images of 1bpp. The source PDF file itself is about 4MB in size.

This pdf file is being printed and the print job (XPS) is being modified (we keep using 1bpp here). After the modified XPS file we save it as a pdf file again with SkiaSharp. However the resulting pdf file now has a file size of 40+mb because all the 1bpp images are automatically converted to 24bpp by SkiaSharp.

input (PDF) --> printed (XPS) --> changes (XPS) --> save with SkiaSharp (PDF)
1 bpp       --> 1 bpp         --> 1 bpp         --> 24 bpp

Describe alternatives you have considered

No other solution found with SkiaSharp

Additional context

The big file size is not acceptable. If we lower the quality of the jpg images the content is not sharp anymore and not acceptable.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

wstaelens avatar Nov 09 '23 10:11 wstaelens