Increasing Resolution and Reducing Size of an Image in Java

后端 未结 2 1836
梦如初夏
梦如初夏 2020-12-10 09:47

When I first asked this, I included as much information as I could, since I never know what will help someone if they can give m a solution, but from the answers, it seems I

2条回答
  •  醉话见心
    2020-12-10 10:01

    No, if you take an 8x10 72dpi image and ask for a 200% zoom you'll get a 16x20 at 36 dpi. You can't magically increase image resolution.

    What counts is the total number of pixels in the image. The stated DPI is just what the DPI will be at a specific size. Take your 8x10 image at 72dpi. It has 576x720 pixels. If you zoom to 200% you still have the same number of pixels, but now they'll be spread out over twice the linear dimensions, meaning the individual pixels will be bigger. Some software will attempt to increase resolution by interpolating pixels, i.e. creating new pixels by averaging the nearest neighbors. This can give the impression of higher resolution but the image does not contain any more data. It always has the effect of softening the image, especially any sharp edges or lines.

    If you reduce the size of an image without resampling, you do increase the printed or displayed resolution, but the image gets smaller. For the same image, increasing the DPI to 144 will reduce the image size to 4x5.

提交回复
热议问题