1

I am trying to add a JPEG image to a Scribus document, and then to export it as PDF; the file size of the resulting PDF should not be much higher.

I just added a frame for an image, loaded the JPEG file into it, and adjusted the image size to the frame's size.

Then I exported it as PDF, and the file size of the PDF was much higher than the JPEG file. The JPEG file has a size of 165 KB, and the PDF's size is 1 MB.

I tried to do the same using , and there the resulting file is 1 MB as well, so same problem.

Then I tried 's convert; there the resulting file is 177 KB, using:

convert 1.jpg 1.pdf

As for Scribus, I tried to change some settings in the PDF export (compression method, max. resolution etc.). This did reduce the file size, but image quality got worse.

How can I include a JPEG image in Scribus, and then export it "as-as" to PDF, without any real transformation, except for scaling (which could be stored just as a factor)?

Update

  • I am using Scribus 1.4.6 on Linux
  • I cannot upload my JPEG file, but I could reproduce it using this file: The JPEG file size is 220 KB, the resulting PDF is 1 MB.

Update 2

This issue has been crossposted to the Scribus issue tracker

  • If your document has other things like text, etc, then the PDF size is potentially subset fonts, metadata, etc that is required to reconstruct the document for display or print. 800KB is actually not a lot of extra bytes for this data. If you are simply putting a jpeg into a document, and then exporting as pdf. Don't. There's no point in this. PDF is a container format and the JPG is still in there and potentially upsampled. The imagemagik command is simply making a pdf the same size and no metadata. – Yorik Jul 2 at 15:03
  • @Yorik The full task is to assemble a PDF document which consists of multiple documents, images etc. The question is reduced to a minimal example showing that issue. convert is actually producing A4 landscape, the same size as Scribus. There is no real difference in the meta data of those PDFs, as reported by pdfinfo. How can I avoid that upsampling? – Beryllium Jul 2 at 15:48
1

I just gave it a try: in Scribus 1.5, including this test image with the automatic settings, gives me a Pdf that is 1Kb bigger than the image itself and pdfimages can extract a jpg that is exactly as big as the original image.

In my experience for jpg images that are somehow ok, the best is to get Scribus not to touch the image during the Pdf export.

You can test with the same image and if you get the same results as I do, but still a much different size with the new settings and your image, you're welcome to share a jpg and a Scribus file that show the problem, so that we can check with it.


Edit: as you might have read in the comments to the ticket, the reason why Scribus cannot include the image you linked is that it's a grayscale jpeg. Scribus does not 100% support them.

Jean has given a list of more reasons why a jpeg file might be resampled when included into a pdf. One of them might apply to the image you're using in your project.

| improve this answer | |
  • Thanks, I tried it using that test image, and the result is fine as you said. So there must be something "wrong" with my JPEG file. I cannot upload my file, but after some searching I found another file which shows the same problem (see updated question). – Beryllium Jul 2 at 15:33
  • 1
    i've tested your images and i can confirm the issue. i've opened a ticket in the scribus bug tracker: bugs.scribus.net/view.php?id=16150 – a.l.e Jul 3 at 10:06
0

the resulting PDF should not be much higher

Well, that is not true. Let me explain.

A PDF can have different settings on compression of the images.

You can have some images not compressed at all, some with lossless compression and some with JPG compression.

If you choose JPG compression, and you did not modify anything on the images, yes, there is a chance the JPG compression, therefore the file size will match. But if you choose another type of compression or none at all, or you set up the RGB files to be converted to CMYK for example, the file will be larger.


Answering the question. Match the compression data with the characteristics of the JPG file. Mainly, use JPG compression and maintain the color mode of the embedded files.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.