When sizing images for a website, the dpi (dots per inch) does not affect the file size of the image in terms of its dimensions in pixels or its storage size on disk.
Key Points
Pixels and File Size
An image that is 2000px wide remains 2000px wide regardless of its dpi.
The file size (in terms of kilobytes or megabytes) of a 2000px wide image is the same whether it's set to 300dpi or 72dpi, assuming the same file format and compression settings are used.
DPI Context
DPI is a measurement of print resolution, not screen resolution.
For web use, what matters are the pixel dimensions (width and height in pixels), not the dpi setting.
Example:
- A 2000px wide image saved as a JPEG file at 72dpi and the same image saved at 300dpi will have the same dimensions (2000 pixels wide) and the same file size on disk.
- The dpi setting is only relevant when printing the image, as it determines how many pixels per inch will be printed. For instance, at 300dpi, a 2000px wide image would be printed about 6.67 inches wide, while at 72dpi, it would be printed about 27.78 inches wide
For web usage, we focus on the pixel dimensions (e.g., 2000px wide) and optimize the image for web use (e.g., using appropriate compression). The dpi setting is irrelevant for web display.