PHP图像处理库 Imagine

MIT
PHP
跨平台
2013-12-31
红薯

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')
;
加载中

评论(0)

暂无评论

暂无资讯

暂无问答

在yii2应用中,使用imagine库生成分享图实战。

这个需求现在特别常见,比如生成小程序分享图、生成朋友圈分享图等等,一般是文字 + 二维码 + 背景模板。今天我们使用imagine来完成这件事情,并作用于网站的面试题模块。 我规划的分享图布局...

09/28 16:20
149
0
1: Version Control Systems( Introduction to Git )

1: Version Control Systems When you're working with teams, you'll generally be making changes to the same files. Imagine you're working on a project to make a Python script, and...

2016/09/14 13:11
0
0
ERDAS 2014安装破解及汉化图文教程

关于ERDAS 2014 的安装破解及其汉化过程: 说明:汉化只是之针对英语能力不能正常满足使用软件的朋友们。如果英语过专八,完全没有必要汉化!在此之前查了好多关于ERDAS汉化的文档,可惜只是...

2016/06/08 01:14
331
0
[Happy DSA] Queue Data Structure

Queues are data structures that, like the stack, have restrictions on where you can add and remove elements. To understand a queue, think of a cafeteria line: the person at the ...

2014/07/26 01:04
12
0
15个PHP库,你值得拥有!(上)

最几年,PHP已经成为最受欢迎的一种有效服务器端编程语言。据2013年发布的一份调查报告显示,PHP语言已经被安装在全球超过2.4亿个网站以及210万台Web服务器之上。PHP代表超文本预处理器,它主...

2015/09/02 11:00
92
0
I only wish the 3 Stooges were

I only wish the 3 Stooges were

2015/05/11 11:08
3
0
do while(0)宏定义巧用

Why do a lot of #defines in the kernel use do { ... } while(0)? There are a couple of reasons: (from Dave Miller) Empty statements give a warning from the compiler so this is wh...

2015/10/04 14:43
31
0
Note: Balance of 2193 indicates you should push this ring, wait at least 1 hour, and rebalance/re...

When add new swift storge node,and rebalance the ring,it Note: Balance of 2193 indicates you should push this ring, wait at least 1 hour, and rebalance/repush,that means copy th...

2013/11/29 10:30
55
0
Oracle Certified Master 11g

Why are you here this page? During my preparation for the certification of Oracle 11g OCM I have made many tests and exercises based on the contents entering the exam. You can s...

2015/06/07 23:41
14
0
从右边看二叉树

原题   Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.   For example:   Giv...

2016/12/27 17:56
13
0

没有更多内容

加载失败,请刷新页面

返回顶部
顶部