9

I will submit an article to Geoscientific Model Development, and the submission instructions requests that I ensure that my figure files are "compiled as *.pdf, *.ps, *.eps, *.jpg, *.png, or *.tif files with a resolution of 300 dpi" before I submit the manuscript for peer review.

What does it mean in practice that my figure files are compiled with a resolution of 300 DPI? How is this relevant when it comes to PNG and PDF files? Do the DPIs of PNG and PDF files have any effect on the final document, and is this even information that is stored in such files?

I know what DPI is and the difference between a raster and a vector image. That's not the issue.

D.W.
  • 8,221
  • 2
  • 31
  • 57
HelloGoodbye
  • 303
  • 2
  • 7
  • 7
    In my experience when people say to use 300 dpi what they really mean is use a high resolution image suitable for printing and not a lower resolution suitable for web or screen. – barbecue Oct 22 '23 at 20:43
  • Don't forget that PDF can contain raster data instead/as well as vector data. So can SVG and probably EPS. This is typically used for annotated photos – Chris H Oct 23 '23 at 14:16
  • PDFs store information about the physical size of the pages they contain. You probably don't realize it because almost every PDF says "I'm 8.5x11" on every page (or whatever the standard outside-the-US size is, I guess), so you never noticed it had the capability. Once you know it has an intended physical size, DPI is a perfectly cromulent thing to talk about again. – Daniel Wagner Oct 23 '23 at 23:31

7 Answers7

20

Well, the instructions are a bit old-school. They have the underlying assumption that you submit your figure files in exactly the size they are printed and they want the resolution of any pixel content of the final paper to be 300 dpi. Of course, in modern typesetting, you can embed any figure at any size. So the instructions translate to: If your figures are embedded at a reasonable size in the final paper, any pixel content should be 300 dpi.

All of this in turn hardly ever matters if you follow the other guideline, which says:

The first choice should be vector graphics

… and for vector graphics, you do not have pixel content in the first place. So, if this is about plots, diagrams, etc., just deliver them in a vector format.

Now, depending on the subject of your research, you may have photographs and similar, but here you cannot control the resolution at this point and are stuck with what you have (see: Is increasing the DPI of a low resolution image a good idea?).

The only case in which you should worry about this guideline is if you have some content that needs to be rendered to pixels and you can control the resolution of the rendering.

Wrzlprmft
  • 61,194
  • 18
  • 189
  • 288
  • Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on [meta], or in [chat]. Comments continuing discussion may be removed. – cag51 Oct 22 '23 at 21:06
17

PNG files are pixel graphics. The requirement simply says that you need to include pictures in PNG format that have a sufficiently high resolution so that they don't look "pixely". In other words, you shouldn't include a 100x100 pixel picture and display it in a figure that covers half a page. (But if that is an inset that shows up in a 5x5 mm area, then 100x100 pixels are enough because that equates to ~500 DPI.)

Wolfgang Bangerth
  • 94,697
  • 7
  • 201
  • 338
  • 3
    Thank you for your answer; I guess that makes sense. So when they write DPI, it sounds like what they probably mean is the number of pixels per inch on a printed version of the paper (which wouldn't be a property of the image itself, but rather its resolution in combination with how it is displayed in the document)? – HelloGoodbye Oct 20 '23 at 18:25
  • 10
    @HelloGoodbye Yes, that's exactly how this should be interpreted. It isn't a property of the image itself, but the number of pixels and how large you make that image on the page and how large the page is. – Wolfgang Bangerth Oct 20 '23 at 19:08
  • @HelloGoodbye DPI is an abbreviation that means 'dots per inch'. It is a measure telling you how detailed or grainy/ pixely a picture will be at a certain size. – quarague Oct 21 '23 at 08:23
  • @quarague I know what DPI stands for. So if it is a measure telling you how detailed or grainy/ pixely a picture will be at a certain size, then what is that size for a PNG image? – HelloGoodbye Oct 21 '23 at 23:23
  • 1
    Note that PNGs do have a method to store DPI information. Of course, in reality the DPI depends on how the image is scaled. But it's possible that the publisher is checking this information in the PNG. – Michael Mior Oct 23 '23 at 13:22
  • 1
    @HelloGoodbye It is the same thing. If you need 300DPI then if you are adding a 1 inch by 1 inch picture to the page the PNG file needs to be at least 300 pixels by 300 pixels to meet that requirement. If you want a 10 inch by 10 inch image then you need at least 3000 x 3000 pixels. – NathanOliver Oct 23 '23 at 15:44
  • @HelloGoodbye It's not the size of the png per se. It's the size of the png on the page. FYI 300 dpi is the general standard for magazines. Newspapers generally print at 150 dpi. 600 dpi is high quality art prints such as posters or glossy art magazines. – slebetman Oct 23 '23 at 18:19
  • @HelloGoodbye FWIW A4 paper is 8.3 inches wide so a full-width image is roughly 2500 pixels wide (300 x 8.3 = 2490). That's just a bit wider than a 4k image. Basically a 4k image is just under half an A4 paper at 300 dpi. – slebetman Oct 23 '23 at 18:22
5

DPI matters for raster graphics, which encode individual pixels. This is to be contrasted with vector graphics file which contain information about shapes. Some formats, like PDF, can contain both raster and vector graphics. PNG is purely a raster graphics format. Too low DPI for raster graphics will look bad if the journal increases the size of the figure. 300 DPI is a common minimum guideline for raster images, but it's generally better to create vector graphics whenever possible.

Anyon
  • 26,132
  • 8
  • 87
  • 116
  • 1
    But is DPI even a property of a PNG file? Isn't what actually matters the resolution of it (i.e., its width and height in pixels)? – HelloGoodbye Oct 20 '23 at 18:20
  • @HelloGoodbye - you do need to be sure there are enough pixels to be able to make a reasonably sized figure out of, assuming it will be printed at around 300 DPI. It needs to be a Figure, not a desktop icon. – Jon Custer Oct 20 '23 at 19:18
  • @JonCuster Thanks. I figured that must have been the case. – HelloGoodbye Oct 20 '23 at 19:47
  • 2
    @HelloGoodbye There are two parts to the answer. 1. The DPI that actually matters for publishing just depends on the number of pixels and the size in which the image is shown in the article, which has its own physical dimensions. 2. The technical part is that DPI is often, but not always, a property of PNG files. The file format specifies the data is organized into various chunks. The so called "pHYs" chunk has three fields. The first two specify the number of pixels per unit along the X and Y axes, giving the aspect ratio. – Anyon Oct 20 '23 at 23:23
  • @HelloGoodbye The third field has value 1 if the unit used is one meter, or value 0 if the unit is unknown. So if the value is 1, there is a specified DPI, and thus the size of the figure is known. If the value is 0, there is no information about the physical size in the PNG file itself. Of course, as per the first part, this physical size is likely to be overridden when you include the PNG into your document. – Anyon Oct 20 '23 at 23:26
  • Thanks for your elaborate explanation! I also figured out that even if the PNG file has a physical size and DPI, those are going to be overriden anyway when I include the PNG in my document. So what does it matter if I compile my PNG images with a resolution of 300 DPI, which the instructions tells me to do? – HelloGoodbye Oct 21 '23 at 23:58
  • @HelloGoodbye What do you mean "going to be overridden"? The journal needs the figures in a certain resolution; if you're using software that's scaling them less than that resolution then this is your problem that you need to solve. – Bryan Krause Oct 22 '23 at 00:35
  • @BryanKrause what I mean by overridden is that once the image is inserted into the document, it is still going to get a new size, which will give it a DPI that depends on the figure size and the resolution of the PNG file, and not of the size and DPI of the PNG file. So the size and DPI file won’t have any effect at all on the final document. – HelloGoodbye Oct 22 '23 at 10:37
  • @BryanKrause That the journal needs the figures in a certain resolution it’s not what they write; they write that they need them in a certain DPI, which is independent of the resolution. – HelloGoodbye Oct 22 '23 at 10:39
  • @JonCuster I'm not sure approximate descriptions like "around 300DPI" will do: I suspect the print shop will resize the image so the existing pixel set is exactly 300DPI, to avoid resampling that could produce weird aliasing effects. – Daniel Hatton Oct 22 '23 at 11:45
  • 2
    @HelloGoodbye You should be producing the figures at the size that they will appear as well as the minimum DPI required. – Bryan Krause Oct 22 '23 at 14:16
3

In some way or other, you will not only submit your images (say, a PNG graphic that is 600 pixels wide and 200 pixels high), but also layout "instructions" where and how big to put that image on a page of (ultimately) paper. If these instructions amount to "as wide as two text columns", then those text columns better be no wider than one inch each, because at 300 dpi, your 600 pixels are good only for 2 inches. If the numbers don't match, your options are to decide that the image shall appear smaller in size (and thereby less impressive, or perhaps your important 3-by-3 pixel markings become almost invisible to the naked eye) or you try to render it at higher pixel resolution.

3
  1. Prefer vector graphics. If you plot using e.g. Matplotlib, then simply outputting a PDF file does the trick in most cases:

    fig, ax = plt.subplots()
    ...
    fig.savefig("figure.pdf")
    
  2. If it must be a PNG file, ensure that it has sufficient pixels to meet the target print DPI and print width. That is, given:

    # An 8 inch wide figure at 300 DPI requires 2400 pixels.
    print_dpi = 300
    print_width_inches = 8
    print_width_pixels = print_width_inches * print_dpi
    

    Your PNG file.

    file_dpi = ... file_width_inches = ... file_width_pixels = file_width_inches * file_dpi

    The following condition must be satisfied:

    assert file_width_pixels >= print_width_pixels
    

    What really matters is if you have the number of pixels needed, file_width_pixels (e.g. 2400 pixels wide). As long as you create a figure with enough pixels, you are good. The other settings (file_dpi, file_width_inches) can be chosen arbitrarily to match this constraint, and don't really matter.

    In fact, you can easily convert an image with "1 DPI" in the metadata field into a "9000 DPI" image with the following command:

    exiftool -XResolution=9000 -YResolution=9000 figure.png
    

    This command neither adds nor removes the only things that are actually important: the pixels. For comparison:

    Image A Image B
    1 9000
    file_dpi = 1 file_dpi = 9000
    file_width_pixels = 234 file_width_pixels = 234

    Clearly, both images are exactly 234 pixels wide, and thus have the exact same quality. The DPI metadata is irrelevant. Look at the number of pixels, not the supposed DPI.

    Regarding Matplotlib again, you may generate the appropriately sized PNG via:

    fig, ax = plt.subplots(figsize=(file_width_inches, file_height_inches), dpi=file_dpi)
    ...
    fig.savefig("figure.png")
    

    Again, the file_dpi does not need to be 300 in order to produce a high quality image. (e.g., file_width_inches=10000000000000, dpi=1 is a perfectly valid choice from the publisher's point of view, though your fonts will be very, very tiny, and your computer may not have enough memory for an image with higher resolution than images from the Hubble Space Telescope. :))

Mateen Ulhaq
  • 262
  • 1
  • 9
2

Technically you can rescale.

I always understood this as a hint to check if your figures are going to look as you desire if they are scaled to the planned size and rendered at 300dpi.

That could affect:

  • rastered graphics (which you may like to represent in an integer multiple to avoid fuzzy edges)
  • minimum line widths/usage of different line widths to indicate data traces in plots
  • filling patterns
  • marker types which you use in plots
  • potentially fonts/sizes which you use (-> font hinting)
  • checking if gray values can be represented appropriately by the raster (300dpi is the B/W resolution, not the resolution in which you can represent a gray value)

The other point which I always understood implied was an polite version of "please don't send a 1200x1200 resolution rasterized graphics".

Sascha
  • 3,700
  • 10
  • 23
  • Thanks for you answer, Sasha! Do you mean that I should scale them in the document so that they get a size that equals the resolution of the PNG file divided by 300 DPI (or rather 300 PPI to get the correct unit) to see what they look like? That is, if I have a 900x600 pixel PNG, I should scale it so that it has a size of 900x600 pixels / (300 pixels/inch) = 3x2 inches in the document? – HelloGoodbye Oct 22 '23 at 10:52
0

This sounds like more of a question for Google than for Academia Stack Exchange, but since preparing figures for the final manuscript and typesetting is always a hassle (would love to hear from anyone who thinks it isn't), here are my two cents:

  1. Anything that is printed will need a higher resolution than something on screen. For example, powerpoint files generally work with a screen resolution of 72 dpi because all they are meant for is to be projected. If you don't want your images to look pixelated in print, you need to ensure they have a resolution of at least 300 dpi. That's just how printing works.

Familiarize yourself with this and differences between vector and raster images - there is lots of information out there online, also through printshops etc. because the same thing holds for printing posters for conferences.

  1. In general, what helps is to prepare your figures at the real (i.e. actual, final) print size. That way you can ensure (by doing test prints yourself) that everything is up to par while preparing the figures.

  2. Save .png for the web, .jpg for test prints/first submissions and always make sure you have high resolution files (.eps, .tif) for final submission. There will always be loss of data when you export as .png and .jpg because there is compression and loss of data (which is why the file sizes are smaller - and we like that until the publisher informs us that the resolution of our images is too low).

Of course any of this may become obsolete in a paperless world, but this is not the reality we live in so it helps to think of eventual printing at all times and to make sure that your raw files and source material do(es) have the right resolution and/or can be exported as such.

BioBrains
  • 3,285
  • 4
  • 14
  • Hi BioBrains; thanks for your reply. I think my question was a bit unclear. I know what DPI is, and the difference between raster and vector images. My confusion is that I have never seen that PNG images or PDF documents can have DPI before, so I don't understand what it means to compile a PNG image or PDF file with 300 DPI. Furthermore, even if a PNG image would have a DPI on its own, the figure in the document that uses that PNG image will still have a DPI that only depends on the figure size and the resolution of the PNG file, and will therefore be independent of the DPI of the PNG file. – HelloGoodbye Oct 21 '23 at 23:09
  • Hence my question how it is relevant what DPI I compile my PNG images with. – HelloGoodbye Oct 22 '23 at 00:01