I have a color laser printer with max resolution specified to be 1200 x 4800 dpi, which is vertical by horizontal resolution based on this answer. I want to print an image at the highest possible resolution, so first I create a tiff file of the image using Matlab, which allows me to specify a single dpi value when I save the file. Do I specify 4800 dpi? Would the printer then print my image at 4800 dpi in the horizontal and 1200 dpi in the vertical? (The use case: I am seeking to print out a small color image containing tiny squares which need to be distinct when seen under a magnifying glass.)
The answers here already explain what DPI is, but your question isn't really what DPI is, but what the highest DPI setting is that you should use for your image.
Just a recap so others don't have to read the comments I posted on the other answers: DPI is a conversion from pixels to physical size, such as cm, inch, etc. When a program or printer uses the DPI setting, it will basically calculate how small or big on the paper the image should be without changing the actual image itself. So a 1024x768 image with a low DPI setting can fill an entire A4 paper, but will look very pixellated when printed, as where the same image printed with a very high DPI setting will appear very small on paper.
Now, what happens if you print on a higher DPI setting than the printer supports, the same basically as when you use your photo editor and resize the photo to a smaller image. You lose details.
This makes the question really hard to answer. If you specify a DPI that is too low, the image gets bigger on paper. If you specify a DPI that is too high, you lose details in the image which can result in text not being readable anymore, or lines vanishing, depending on how much fine detail the image has.
Although I cannot answer the question for sure, because I don't know how well the printer copes with a DPI that is too high, I suspect that if you go higher than the 1200DPI setting on the vertical axis, you will lose details. So even though 4800 DPI is on the wide axis, I suspect that 1200DPI should be the maximum DPI setting you should use in order to ensure that you won't actually lose any information.
You could test this by creating an interlaced pattern based image with one pixel black, then one pixel white, then one pixel red then one pixel white, then one pixel green and one last pixel white and repeat that vertically (so you get a long vertical line (you can make these pixels wider though, so the line is easier to spot), then print it out on 1200DPI and on 4800DPI and see if you are keeping the information, or that some colors vanish.
Even better would it be if Matlab can somehow specify different DPI settings for the entire image. It is also possible that the printer calculates the dimensions based on a formula and thus the max DPI setting you could use is 3/4th of 4800DPI, namely 3600DPI (because 1200DPI is 1/4th of 4800DPI, so you reduce that from 4800DPI to compensate for going over.
So my answer is going to be: experiment a little to make sure. The information in this answer should help you understand how and why it works like this.
Printer DPI (dots per inch) and image resolutions, measured in PPI (pixels per inch) -- confusingly enough too many sources use DPI for this also, even though they shouldn't -- are not the same, nor are they equivalent.
With one exception (see below), when printing greyscale or colour images, you do not need one pixel for every dot a printer can print in order to have ooptimum quality. As harrymc pointed out, in the case of colour or grayscale images, 300 PPI is usually enough. The increase in printer resolution merely means you have access to more shades of gray as pointed out by the formula in the first answer in the link (
(Output Resolution / Screen Frequency)^2 + 1 = Gray Levels) provided in the question.
The exception is line art which you want to save as a bitmap (not the file format, the bit depth), where every pixel is either black or white and cannot be any other colour. In the case of line art, you ideally want to match the printer's resolution. That said a line 1/1200th of an inch wide is thin indeed and finer detail is probably wasted on anyone looking at the image at a normal viewing distance (40-60 cm) since it roughly matches the human eye's acuity (see this answer). So 1200 PPI is usually enough for line art.
Dots per inch (DPI) is :
Dots per inch (DPI, or dpi) is a measure of spatial printing or video or image scanner dot density, in particular the number of individual dots that can be placed in a line within the span of 1 inch (2.54 cm).
DPI is a measure of how many dots in an inch, or in other words the quality of the image. A higher DPI helps when you are printing the image on a larger surface, such as a high-quality printer, to avoid pixels being "smeared".
The DPI has effect when the image is created, usually by a scanner, or in your case Matlab. Changing it afterward makes no sense.
The DPI is a property of the entire image and has no horizontal or vertical components.
You may specify any DPI that works with your printer. The default is usually 300, but for a high-quality printer 600 or 1200 is enough.
You may have meant resolution rather than DPI, and in this case the best one is the one that matches the printer,
The print quality also depends on the program you are using for the print, as well as on the printer being set to high quality print.