1

I am writing my thesis but due to the quantity and quality of images, the pass comes out at 26MB. The platform where I have to upload my document only allows me up to 5MB, so I need to compress my file. I have tried it with some external program but it leaves my graphics too horrible. I also read a way to do it with GhostScript, but I really don't understand how to do it. I know there are several posts on this topic but I would be infinitely grateful if someone could tell me step by step how to do it. I'm using MikTex on my computer.

Following @Skillmon's suggestion:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{graphicscache}

\begin{document} \begin{figure}[h] \centering \includegraphics[scale=0.5]{image.png} \end{figure} \end{document}

I got an error but at that moment I put this (trying to use shell-escape): enter image description here

I know I'm wrong but based on this I think my question is a bit more concrete (I'm using Miktex on Windows)

Zaragosa
  • 599
  • you can use programs such as imagemagic convert to resample the images to be smaller filesize, but there is no right and wrong answer, you have to judge how small you can go while maintaining acceptable quality – David Carlisle Jan 23 '22 at 17:44
  • The graphicscache package might be helpful for the automatic downscaling to the desired DPI of your document. – Skillmon Jan 23 '22 at 17:46
  • Thanks @DavidCarlisle, I'm going to try it to see how it goes with that. – Zaragosa Jan 23 '22 at 17:50
  • Thanks @Skillmon , So with that package the reduction is automatic? I'm going to try it – Zaragosa Jan 23 '22 at 17:51
  • 1
    @Zaragosa I already linked to the CTAN-page of graphicscache on which you can find the documentation. I suggest you read that and if you have specific problems regarding it you ask specific questions, that'll be faster and better than me reading the documentation of a package (I've never used myself) for you and trying to show some usage examples. If you come up with a working setup using the package (or not) you could then write a self-answer here for future visitors. – Skillmon Jan 23 '22 at 17:54
  • @Zaragosa it's advertised as such. But remember that it needs shell-escape. – Skillmon Jan 23 '22 at 17:55
  • It is obvious that the images size is the key. (If compiling the document without images outputs >5MB, then you might be in trouble ;)). Besides downscaling the DPI or use a higher compression level for images (possible, for example, in .jpg and .png), you might try using grayscale images–if that is acceptable in your work. Note that a grayscale image is not a color image with only gray values (!): a grayscale image takes less bits per pixel. – loved.by.Jesus Jan 23 '22 at 18:15
  • @Skillmon Yes, thanks, I have already downloaded the package, but I get an error in \includegraphics[width=9.5cm]{Figures/image.png}. Maybe I didn't put "shell-escape", but I'm new to this, where should I write it? I'll modify my question to show my attempt. – Zaragosa Jan 23 '22 at 18:29
  • @loved.by.Jesus Thank you very much for the suggestions, I had also thought about it but I need to use color to distinguish several things in the images, if not, I will apply your advice in one. – Zaragosa Jan 23 '22 at 18:31
  • @user202729 Thanks, I need to add a space at the end, and everything went well, now it weighs 12MB. I still have to keep going down but it's pretty good – Zaragosa Jan 23 '22 at 19:02
  • @Zaragosa what's the target DPI you want to get? graphicscache by default uses 300 DPI, if that's bigger than what's required by that platform you could save even more (obviously at the expense of quality). – Skillmon Jan 23 '22 at 19:20
  • @Skillmon How can you modify or reduce these 300 DPI? I would have to play trial and error, to see something that fits the weight. – Zaragosa Jan 24 '22 at 01:39
  • @Zaragosa read the documentation! Hint: You want to change the DPI, so maybe search for that in the PDF. – Skillmon Jan 24 '22 at 17:42
  • Have you LOOKED at the folder of your images and sorted them by filesize? Surpringly no mention of that at all. That would seem to be the most relevant first step before any of the other stuff above? How much of the problem is caused by how many files? – Aubrey Blumsohn Jan 28 '22 at 11:44

0 Answers0