Hi,
I've recently started using Latex and adding graphics with the graphicsx package. I've found that Latex is rather poor at upscaling images so I've tended to include image files with a larger resolution than I expect is required. The problem is, my PDF files are now massive and impractical to email out. This got me wondering: what size is best to include images?
Say I want an image to be as wide as the text, is the following thinking correct?
Assumptions
Image Width = 18cm (max)
Printer resolution = 150 dpi (is the the average printer resolution?)
1 inch = 2.5cm
So,
18cm = 7.2 inches = 1080 dots....
IE - My images should have a width of around 1000 pixels?
Thanks!
Graphics, Figures & Tables ⇒ What size to compress images to?
What size to compress images to?
Last edited by RiW on Wed Sep 01, 2010 7:51 pm, edited 1 time in total.
Re: What size to compress images to?
What purpose will your document serve? Will it be send for printing or reading from screen? The best way is to do some planning before including any graphic material. So, if your text width will be 18cm max, it is the best way to prepare your image (in an image editor like GIMP or Photoshop...) to fit that dimension (or to be a little bit larger) and set the resolution in the editor (about 300 dpi or more for printing (150dpi is an absolute minimum; some people recommend 267dpi), but 72 dpi is probably enough for screen reading; you may try different values though to see which one fits your needs). And, not to forget, never scale a bitmap image (png, jpg etc.) above 100% since that leads to apparent loss of quality.
Re: What size to compress images to?
Thanks for that.
I'm writing a report that will be printed and also emailed out, so I suppose I'll have to keep the high quality images. Unless there's a way / package to create PDFs optimised for each purpose?
Also, did my rough calculation method sound right? i.e. dpi = number of pixels in a one inch line
I'm writing a report that will be printed and also emailed out, so I suppose I'll have to keep the high quality images. Unless there's a way / package to create PDFs optimised for each purpose?
Also, did my rough calculation method sound right? i.e. dpi = number of pixels in a one inch line
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
What size to compress images to?
You have to take the relation between postscript point (also called big point) and pixel into account. Therefore pixel based graphics have to be scaled to three quarters of their size for proper appearance in the final output (see Forum Search for details, keyword »postscript point«).RiW wrote:[…] Also, did my rough calculation method sound right? i.e. dpi = number of pixels in a one inch line
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
What size to compress images to?
Yeah, it is possible. You may use different file types for different purpose (but with same names), let's say, high-resolution .png files for printing, and low-resolution .jpg files for reading from screen. Now, all you have to do is to omit the extension of the picture when including it in the document, e.g., use: \includegraphics{my_picture} instead of: \includegraphics{my_picture.png}.RiW wrote:Thanks for that.
I'm writing a report that will be printed and also emailed out, so I suppose I'll have to keep the high quality images. Unless there's a way / package to create PDFs optimised for each purpose?
To decide which format should be used when compiling your document, you may change the extension list. Add the following code into your preamble:
Code: Select all
\DeclareGraphicsExtensions{.png,.jpg,.pdf}
There is also another way: keep pictures in two different subfolders, e.g., A and B, then use a custom command, something like this:
Code: Select all
\newcommand{\mypic}[1]{\includegraphics{./A/#1}}
Re: What size to compress images to?
Fantastic - many thanks meho_r... exactly what I was looking for! Will give it a go now.
Thanks again!
Thanks again!
What size to compress images to?
For optimizing your images while keeping quality, you could also try a tool like image compressor. It allows you to adjust image sizes without compromising clarity, perfect for managing different PDF output sizes for print or screen. This way, you maintain high-quality visuals but with smaller file sizes, making them easier to share.