gpt4 book ai didi

imagemagick - 如何使用 ImageMagick 查找每英寸像素 (PPI)

转载 作者:行者123 更新时间:2023-12-04 22:33:31 29 4
gpt4 key购买 nike

我可以使用以下命令获取 JPEG 图像的 PPI:

$ identify -format "%w x %h %x x %y" mypic.jpg 
1600 x 1200 72 PixelsPerInch x 72 PixelsPerInch

但是,当我在 PNG 格式上运行相同的命令时,我得到每厘米像素数:
$ identify -format "%w x %h %x x %y" mypic.png 
1600 x 1200 28.35 PixelsPerCentimeter x 28.35 PixelsPerCentimeter

有没有办法更改命令以获取 PNG 格式的每英寸像素数(PPI),或者可能根据每厘米像素计算 PPI?

最佳答案

您可以简单地添加选项

-units PixelsPerInch

关于imagemagick - 如何使用 ImageMagick 查找每英寸像素 (PPI),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14632254/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com