Imagine-PHP

PHP图像处理库
授权协议 MIT
开发语言 PHP
所属分类 程序开发、 图形/图像处理
软件类型 开源软件
地区 不详
投 递 者 蔡弘扬
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Logo

Imagine 是 PHP 一个强大的图像处理库,要求 PHP 5.3 及更新版本,其灵感来自于 Python 的 PIL

示例代码:

<?php

$imagine = new Imagine\Gd\Imagine();
// or
$imagine = new Imagine\Imagick\Imagine();
// or
$imagine = new Imagine\Gmagick\Imagine();

$size    = new Imagine\Image\Box(40, 40);

$mode    = Imagine\Image\ImageInterface::THUMBNAIL_INSET;
// or
$mode    = Imagine\Image\ImageInterface::THUMBNAIL_OUTBOUND;

$imagine->open('/path/to/large_image.jpg')
    ->thumbnail($size, $mode)
    ->save('/path/to/thumbnail.png')
;
  • <?php namespace frontend\controllers; use frontend\components\BaseRestController; use Imagine\Image\Box; use Imagine\Image\ImageInterface; use Imagine\Image\ImagineInterface; use Imagine\Image\Palet

  • 首先安装imagemagick软件。 windows下,到官网 http://www.imagemagick.org/script/download.php 下载,安装。 然后,确保php插件安装成功 [img]http://dl2.iteye.com/upload/attachment/0125/4492/c0ecc02e-5cee-3327-b9a7-1a6a8e40f033.png[/img

  • 我正在从事一个由两个内部项目组成的Symfony项目.一个项目和MARKETPLACE项目. 这是文件在网络中的结构. web/ ---one/ #this one is being called from subdomain one.domain.com ------/app_dev.php ---marketplace/ #this one is being called from the m

  • 本篇文章主要介绍了”Yii2 yii2-imagine的使用 “,主要涉及到Yii2 yii2-imagine的使用 方面的内容,对于Yii2 yii2-imagine的使用 感兴趣的同学可以参考一下。 <?php /** * 图片常用处理 * * 需要 yii/yii2-imagine 的支持 * php composer.phar require --prefer-dist yiis

  • 用户评论: [#1] Kubo2 [2015-03-22 12:05:41] What's funny with PHP's $this variable and variable variables: Imagine you have a class like below: private$foo=9; function__construct() {$varName='this'; $$varN

  • 用户评论: [#1] lucas dot delmas at live dot fr [2013-07-07 19:15:23] The imagearc function has a precision of one degree. The function truncates the $start and $end values to the inferior degree. For exam

  • <?php /** * 图片常用处理 * * 需要 yii/yii2-imagine 的支持 * php composer.phar require --prefer-dist yiisoft/yii2-imagine * * 文件上传参考文档编写文件上传类 * @link http://www.yiiframework.com/doc-2.0/guide-input-file-up

  • //压缩 Image::thumbnail('@webroot/img/test-image.jpg', 120, 120)->save(Yii::getAlias('@webroot/img/thumb-test-image.jpg'), ['quality' => 100]); echo Yii::getAlias('@webroot/img/thumb-tes

  • 示例控制器: <?php /** * 图片常用处理 * * 需要 yii/yii2-imagine 的支持 * php composer.phar require --prefer-dist yiisoft/yii2-imagine * * 文件上传参考文档编写文件上传类 * @link http://www.yiiframework.com/doc-2.0/guide-input

  • 安装:composer require --prefer-dist yiisoft/yii2-imagine 查看是否安装成功, 安装了两个目录分别是 vendor/imagine vendor/yiisoft/yii2-<br>使用方法imagine 使用 引入 use yii\imagine\Image; 实例化 $imagine = new Image(); `/压缩 Imag

  • 本文测试可用 之前在WEB开发笔记写过一个PHP生成缩略图的函数,虽然那个函数能够生成缩略图,但是有一定的缺陷,在生成PNG缩略图的时候,背景是黑色,今天又写了一个函数来弥补一下。代码很简单,就是imagealphablending($thumb,false);与imagesavealpha($thumb,true);很重要.主要就是把PNG的alpha值保存,不要丢失而已。 /* *$soure

  • you are pulling my leg? 你在开我的玩笑吗? i don’t buy your story. 我才不相信呢. all in all… 总而言之 all the best! 一切顺利 anything will do! 甚莫都行 anything you say! 悉听尊便 are you sleepy? 你困了吗? business is business! 公事公办 by

 相关资料
  • 大多数图像处理和操作技术可以使用两个库进行有效的处理:Python Imaging Library (PIL) 和 OpenSource Computer Vision (OpenCV)。 下面来简单介绍一下这两个库。 Python 图像库 Python 图像库, 全称为 Python Imaging Library,简称PIL,是Python图像操作的核心库之一。遗憾的是,PIL 的开发工作已经

  • Tensorflow封装了很多图像处理的操作,包括读取图像、图像处理、写图像到文件等等。在批量处理图像时,Tensorflow要求所有的图像都要有相同的Size,即$$(height,width,channels)$$。 读取图像 %matplotlib inline import tensorflow as tf import numpy as np #mil.use('svg') mil.us

  • 安装扩展 使用Composer安装ThinkPHP5的图像处理类库: composer require topthink/think-image 图像操作 下面来看下图像操作类的基础方法。 打开图像文件 假设当前入口文件目录下面有一个image.png文件,如图所示: 使用open方法打开图像文件进行相关操作: $image = \think\Image::open('./image.png');

  • PHPPHP 是一个用 PHP 实现的 PHP 虚拟机。 使用方法:php php.php -r "var_dump('foo');"

  • 主要内容:GD 库PHP 提供了丰富的图像处理函数,主要包括: 函数 描述 gd_info() 取得当前安装的 GD 库的信息 getimagesize() 获取图像信息 getimagesizefromstring() 获取图像信息 image_type_to_extension() 获取图片后缀 image_type_to_mime_type() 返回图像的 MIME 类型 image2wbmp() 输出WBM

  • Matplotlib 软件包中的 模块提供了加载、缩放和显示图像的功能,该模块只能支持 PNG 格式的图片,如果格式不符,需要对图片的格式进行转换。 Matplotlib 支持的图片格式非常有限,所以通常情况下,建议采用 Python 图像处理库 Pillow 来处理图像,若感兴趣可以自行了解。 下面示例,imread() 函数用于读取图像数据并形成 ndarray 数组 ,其数据类型为 floa

  • 缩略图功能 通过http请求获取缩略图 在GET请求参数中添加thumb=1&w=${IMAGE_WIDTH}&h=${HEIGHT} 例子: 原图地址: https://cdn.cnbj0.fds.api.mi-img.com/fds-demo/mi5.jpg 缩放为100x200: https://cdn.cnbj0.fds.api.mi-img.com/fds-demo/mi5.jpg?th

  • CodeIgniter 的图像处理类可以使你完成以下的操作: 调整图像大小 创建缩略图 图像裁剪 图像旋转 添加图像水印 可以很好的支持三个主流的图像库:GD/GD2, NetPBM, 和 ImageMagick。 注意: 添加水印操作仅仅在使用GD/GD2时可用。另外,即使支持其他的图像处理库,但是为了计算图像的属性,GD是必需的。然而,将使用你制定的库来进行图像处理操作。 初始化类 像 Cod