Hi,
For JPG and PNG, I use the command Resample to change the DPI. The original image has a size of 1920 * 1080 (96 dpi). For JPG works well. For PNG, I get the image of 15242 * 8574 (762 dpi)
Path of code:
Image. Read ("D:\artscope\96dpi\screenshots\96.png")
Image. Resample (300, 300)
Image. Write ("D:\artscope\96dpi\screenshots\96to300.png")
Command line works corrrect.
Version:ImageMagick-7.0.7-11-Q16-x86-dll
What's wrong?
Resample JPG and PNG
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Resample JPG and PNG
You need to specify the units with the density. See -units. PNG only supports dots per centimeter. So the values are converted from dpi to doc. The difference is due to the units conversion. 300 dpi *2.54 cm/in = 762 dpi. Review your input and output for the units specified.
Re: Resample JPG and PNG
Thank you for the quick and accurate answerfmw42 wrote: ↑2017-11-15T10:05:46-07:00 You need to specify the units with the density. See -units. PNG only supports dots per centimeter. So the values are converted from dpi to doc. The difference is due to the units conversion. 300 dpi *2.54 cm/in = 762 dpi. Review your input and output for the units specified.