- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
不知道在哪里,但我遇到了一个图像托管网站,它允许您以大格式上传图像或对其进行锐化。
我个人不记得或不知道 GD 库有任何锐化图像的功能,这可能只是质量提升的不同词。
如果有人知道锐化图像的功能,请告诉我,因为我个人在 Image Magic 和/或 GD 库中都不知道此类功能。
最佳答案
您可以使用 imageconvolution在带有锐化蒙版的 GD 中。来自 http://adamhopkinson.co.uk/blog/2010/08/26/sharpen-an-image-using-php-and-gd/ :
PHP and GD can sharpen images by providing a matrix to
imageconvolution
:// create the image resource from a file
$i = imagecreatefromjpeg('otter.jpg');
// define the sharpen matrix
$sharpen = array(
array(0.0, -1.0, 0.0),
array(-1.0, 5.0, -1.0),
array(0.0, -1.0, 0.0)
);
// calculate the sharpen divisor
$divisor = array_sum(array_map('array_sum', $sharpen));
// apply the matrix
imageconvolution($i, $sharpen, $divisor, 0);
// output the image
header('Content-Type: image/jpeg');
imagejpeg($i);
关于php - 使用 PHP gd 库提高图像质量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6141713/
在本地主机上,该库运行良好,当在生产环境中调用该函数时,php 会抛出一个 fatal error 。 我检查了那里的 phpinfo(),它已启用。 我想看看是否可以在 php.ini 上添加任何内
当我在“配置命令”中的 phpinfo() 输出显示时,如何启用(或者我可能需要安装)GD; --without-gd ? 我的 phpinfo() 输出“Core”中也没有任何内容,其中列出了“gd
当我在“配置命令”中的 phpinfo() 输出显示时,如何启用(或者我可能需要安装)GD; --without-gd ? 我的 phpinfo() 输出“Core”中也没有任何内容,其中列出了“gd
我正在尝试使用 GD 函数:imagettfbbox(),但它未定义。自从我在 Ubuntu 21.10 上以来,我已经编译了我自己的带有 argon2 支持的 PHP 版本。 我是这样配置的: ./
我正在尝试使用 GD 函数:imagettfbbox(),但它未定义。自从我在 Ubuntu 21.10 上以来,我已经编译了我自己的带有 argon2 支持的 PHP 版本。 我是这样配置的: ./
我已经通过一些在线资源自学了机器学习,但我有一个关于梯度下降的问题,但我无法弄清楚。 梯度下降的公式由以下逻辑回归给出: Repeat { θj = θj−α/m∑(hθ(x)−y)xj }
我在 centos 7 服务器和 nginx 网络服务器上使用 laravel 网络框架,我安装了 php71w-gd,但当我想上传文件时仍然出现此错误 Intervention \ Image \
我正在尝试安装 moodle,但它显示缺少/应该启用 php-gd 扩展。然而,gd 已经安装并且是最新的,当我命令 php -v 时,我收到以下错误,如下所示。 PHP Warning: PHP
编译最新的2.0.35版本,用默认的 ./configure编译 当make的时候,出现以下错误 configure.ac:64: error: possibly undefined macro
我有一个函数可以用来接受用户上传的图像,按比例将其缩放到最大宽度/高度为 4,000 像素,还可以生成 400 像素和 800 像素的缩略图。它需要能够处理透明的 PNG 并应用白色背景。 我当前的代
我试图弄清楚为什么我无法在我的 Debian 7 服务器上安装 GD perl 模块。这是我安装核心内容的方式: sudo apt-get install libgd-gd2-perl 然后运行
如何使用 PHP GD 库制作清晰度滤镜? 所以这... 转向这个... 如果用 PHP 做不到,还有什么其他语言可以做到? 最佳答案 我认为他想使用 PHP 的 GD 库。这很简单:function
我尝试使用 php gd 创建验证码图像: $im = imagecreatetruecolor(100, 25); $white = imagecolorallocate($im, 255, 255
我在网上找到了一些关于 PHP+GD 图像处理的内容,但似乎没有一个能给我我想要的东西。 我让人上传任意尺寸的图像,我编写的脚本将图像大小调整为不超过 200 像素宽 x 200 像素高,同时保持宽高
你好, 我试图围绕中心旋转一个圆形图像,然后切掉边。我看到了 imagerotate 函数,但它似乎没有围绕中心旋转。 有人有什么建议吗? 谢谢。 更新:由于它是一个圆,我想剪掉边缘并使我的圆保持相同
我正在尝试在特定图像上添加文本。它工作完美,但图像质量较低,尤其是 papyrus.ttf 字体。如何提高图像中文本的质量。但我需要高质量来打印输出。这是我的代码..它非常简单。 header("Co
我正在使用 jQuery 的 imgAreaSelect插件,以便裁剪图像并保存缩略图以在比例发生变化等情况下使用。不幸的是,结果与我的预期相去甚远,而且我无法做到正确。图像整体调整大小,而不是被裁剪
好吧,一个小背景故事。我正在重新设计我的一个旧网站,我想使用 Myriad Pro对于页面上的标题。这对于 PHP 等将是动态的。 起初我认为我应该只使用 CSS 样式并将 Myriad 定义为主要字
我想使用 GD 裁剪图像,但我希望它围绕特定形状裁剪,而不仅仅是一个正方形。 这可能吗? 最佳答案 一种方法是创建一个所需正方形大小的蒙版,其中包含一个透明的 alpha channel 。然后将其放
在 PHP GD 中,如何在不丢失任何的情况下将真彩色图像转换为调色板 颜色。用imagetruecolortopallete它不起作用。我有一个函数可以遍历所有颜色并过滤它们(例如灰度)。而且它不会
我是一名优秀的程序员,十分优秀!