在PHP中将图像的分辨率从72改为25 dpi [英] Change resolution of image from 72 to 25 dpi in PHP

查看:153
本文介绍了在PHP中将图像的分辨率从72改为25 dpi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用PHP将图像的分辨率从72改为25 dpi吗?

I want to change the resolution of the image from 72 to 25 dpi using PHP?

是否有可能?

问候,

Salil Gaikwad

Salil Gaikwad

推荐答案

这不是可能(至少使用PHP / GD,不确定ImageMagik ),抱歉。

It's not possible (at least with PHP/GD, not sure about ImageMagik), sorry.

但是你可以尝试模仿它,假设你想要创建一个400x300 25 dpi 图像,这里是数学:

However you can try mimicking it, lets say you want to create a 400x300 25 dpi image, here is the math:

WIDTH

72 -------- 400
25 -------- w = (25 * 400) / 72 (=) w ~= 139 pixels

高度

72 -------- 300
25 -------- h = (25 * 300) / 72 (=) h ~= 104 pixels






您创建一个新的139x104 72 dpi 图像,使用它并在完成后将其调整为400x300像素。


You create a new 139x104 72 dpi image, work with it and after you're done resize it to 400x300 pixels.

这篇关于在PHP中将图像的分辨率从72改为25 dpi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆