Why does the sharpness of the imag decrease when I increase the DPI of an image?
DPI is only meaningful for print or a physical display. If you are still seeing and printing the image at the same size, then nothing changes.
Now, if you change the DPI and render the image at that DPI, the image will become smaller. This will make the image look sharper just because details are smaller.
Well, let's say, it doesn't if you only change the dpi without re-rendering the image.
DPI is not very meaningful for image-files, at least until you print them.
So unless you change the pixel dimensions of an image, changing the DPI will do nothing in Photoshop other than attaching this value to the image. You can test this by disabling
However, if you increase the DPI and have the dimensions set to something else like mm, inches, cm etc, then you are changing the pixel dimensions of the image.
This will cause the image to be re-rendered in the new dimensions. As long as the pixel count is a multiple like x2 of the original size, this is fairly easy, but this only seldom is the case. So Photoshop has to interpret the image. The interpreter can be chosen via
Resample image. Each option has its own merits.
This step can reduce sharpness just due to the resampling.
The secondary effect is, that sharpness is more or less another word for contrast between pixels of differing brightness. By resampling an edge that formerly transitioned from black to white in 4 pixels, it might mean that the transition now takes 8 pixels, as the resolutions was doubled.
Seen from far away, the sharpness ist the same, but if you zoom in, it looks less sharp.
For that reason, it is sometimes needed to resharpen the image after changing the pixel resolution.