LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-21-2022, 07:15 AM   #1
Trap in bugs
LQ Newbie
 
Registered: Jul 2022
Posts: 22

Rep: Reputation: 0
Which software for gnu/linux to convert images to PDF with lossless JBIG2 compression locally?


Here I come for such an old question. I asked this question before, but in fact, it was not solved, it was just I gave up last time.

To prevent from getting stupid or duplicate answers. I need to explain in advance.

JBIG2 COMPRESSED IMAGE AND IN PDF. not only “JBIG2 image”(without PDF container), not only “convert image to PDF”, not other compression type.

JBIG2 compression can only be used for binary images, in other words, the images contain only two colors, white and black, no gray, no other colorful.

PDF is the only format that support JBIG2 and often used and easily to use.

Software “ImageMagick” and "GraphicsMagick" do not and will not support it.

The software “jbig2enc” in github is buggy to me, no confidence or patience to solve it. The software “image-to-jbig2-pdf” in github is compiled for Microsoft Winodws and too old for Linux.

JBIG2 has lossy way and lossless way, but I want to use lossless only, do not worry the damage to images for me.

For binary image, JBIG2 compression can be better than png, lossless webp, and group4 compression. No need to suggest any other compression method.

Relying on online Internet tool is not a good idea for batch process.
 
Old 10-21-2022, 09:15 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Interesting. I never tried this encoding. I found jbig2enc for Ubuntu - a repo here:

https://launchpad.net/~alex-p/+archive/ubuntu/jbig2enc

Also, it's a snap version:

https://snapcraft.io/install/jbig2enc/ubuntu

It is old software, but looks like it's still maintained. In this situation, I guess the snap is not such a bad idea because of dependencies. So I installed it and gave it a try.

Not so very well documented, but I made a PDF like this:

Code:
jbig2enc -s --pdf mypicture.png
jbig2enc.pdf output>mypicture.pdf
The first command created 2 files, output.000 and output.sym. The second command is a python script creates a pdf of the 2 files.

The result was a very tiny PDF (2.6kb) with a black and white version of my picture (1.6mb - but 32bits RGBA).

This worked well on KUbuntu 22.04, but I think the snap should work on most distros. Just running "jbig2enc" shows some options, but I have to admit I really don't understand them.
 
Old 10-21-2022, 10:18 AM   #3
Trap in bugs
LQ Newbie
 
Registered: Jul 2022
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Guttorm View Post
Interesting. I never tried this encoding. I found jbig2enc for Ubuntu - a repo here:
……
Also, it's a snap version:
……
Oh my Marx. I do not like Ubuntu, not using it, and my distribution does not support snapd.

Maybe I should keep waiting for another answer.
 
Old 10-29-2022, 03:18 PM   #4
Lucasss
LQ Newbie
 
Registered: Oct 2022
Posts: 2

Rep: Reputation: 0
I support the opinion that quality programming makes life much easier
 
Old 10-30-2022, 01:45 AM   #5
Trap in bugs
LQ Newbie
 
Registered: Jul 2022
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Lucasss View Post
I support the opinion that quality programming makes life much easier
Yeah. But I am so sad that capitalism make programmers work much more separately. So many GNU/Linux distribution (hard to test and choose and be accustomed to for newbies and especially for non-English speaker), so many different softwares do duplicate work, so hard for a single software to run in different operating systems......
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [Waiting for answer]How to convert images to pdf and compress it by jbig2 way on GNU/Linux? Trap in bugs Linux - Software 9 09-24-2022 09:10 AM
How to create pdf files within jbig2 compressed images on GNU/Linux? Trap in bugs Linux - Software 1 07-19-2022 08:41 AM
question about using jpegtran for lossless compression of jpegs syssyphus Linux - Software 0 10-09-2006 07:12 PM
lossless data (de)compression algorithms for red hat zivsh Red Hat 1 05-30-2006 02:08 AM
What is mean by lossless audio compression? hkl8324 General 11 06-28-2005 11:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration