search
HomeBackend DevelopmentPHP TutorialChinese documentation for PHP functions calling ImageMagick

Chinese documentation for PHP functions calling ImageMagick

Apr 14, 2018 pm 05:11 PM
imagemagickphpdocument

This article mainly introduces the Chinese documentation of the PHP function for calling ImageMagick. It has a certain reference value. Now I share it with you. Friends in need can refer to it

Introduction: The author of iMagick did not tell you which functions and methods can be used. These functions and methods are found from the definitions in the source file. The author fumbles and tests. Please test it with the example code, otherwise it will be difficult to understand.

Inverse color imageNormalized imageImage decoration classat Apply a border to the pictureRelief effectEfficiency filter classcharcoal penInternal exposure effect##boolboolbool
Function Description
图片构造类 image_handle = imagick_readimage([image file]) 读取图片到handle
  bool = imagick_writeimage([source image handle],[new name & filetype]) 写图片
  UN KNOW USE = imagick_writeimages  
  new_handle = imagick_clonehandle([image handle]) 复制出新句柄
  image_handle = imagick_image2blob([blob handle]) 将数据流数据转换成为image数据
  imagick_blob2image 与image2blob相反
  image_handle = imagick_getcanvas([color],[canvas width],[canvas height]) 创建一个画布
  UN KNOW USE = imagick_newimagelist  
错误句柄类 bool = imagick_iserror([image handle]) 最后一次执行是否成功
  rason_string = imagick_failedreason([image handle]) 如果执行iImagick函数返回假将可以从本函数抛出失败
  desc_string = imagick_faileddescription([image handle]) 显示抛出的异常描述
  error_string = imagick_error([image handle]) 返回错误内容
获取图片信息类 image_width = imagick_getwidth([image handle]) 获得图片宽度
  image_height = imagick_getheight([image handle]) 获得图片高度
  mime_string = imagick_getmimetype([image handle]) 获得图片MIME类型
  depth_int = imagick_getimagedepth([image handle]) 获得图片DEPTH值
  colors_num = imagick_getnumbercolors([image handle]) 获得图片颜色数量
  bool = imagick_isgrayimage([image handle]) 是否会度图片
  bool = imagick_ismonochromeimage([image handle]) 是否单色图片
  bool = imagick_isopaqueimage([image handle]) 是否不透明图片
  bool = imagick_ispaletteimage([image handle]) 是否彩色图片
  image_type = imagick_getimagetype([image handle]) 获得图片颜色值
  bool = imagick_isimagesequal([image handle1],([image handle2])) 图片是否相同
  magick_type = imagick_getmagick([image handle]) 获得图片类型
  int = imagick_getcolorspace([image handle])  
图片转换类 bool = imagick_convert([image handle],[new type]) 将图片数据转换成为指定格式
  bool = imagick_setcompressiontype([image handle],[compression type]) 指定图片的压缩方式
  bool = imagick_setcompressionquality([image handle],[quality value]) 指定图片的压缩质量
尺寸调整类 bool = imagick_resize([image handle],[new width],[new height],[filter type],[blur],[geometry]) 改变图片尺寸
  UN KNOW USE imagick_magnify  
  UN KNOW USE imagick_minify  
  bool = imagick_scale([image handle],[new width],[new height],[geometry]) 按照指定比例缩小图片
  bool = imagick_sample([image handle],[new width],[new height],[geometry]) 缩小产生样本图片
  bool = imagick_zoom([image handle],[new width],[new height],[geometry]) 放大图片
字体设置类 bool = imagick_setfontsize([image handle],[size]) 设置字体大小
  UN KNOW USE imagick_setfontstyle  
  bool = imagick_setfontface([image handle],[Font Name]) 设置采用的字体
绘图类 bool = imagick_begindraw([image handle]) 开始在一个image上绘画
  bool = imagick_drawannotation([image handle],[x],[y],[text]) 在image上的x y开始画一些文字符号
  bool = imagick_drawrectangle([image handle],[up x],[up y],[low x],[low y]) 画一个矩形
  bool = imagick_drawellipse([image handle],[starting x],[starting y],[ending x],[ending y],[start rotation in degrees],[end rotation in degrees]) 画一个椭圆形
  bool = imagick_drawarc([image handle],[origin x],[origin y],[ x radius],[ y radius],[ start rotation in degrees],[ end rotation in degrees]) 画一个弧形
  bool = imagick_drawcircle([image handle],[origin x],[origin y],[perimater x],[perimater y]) 画一个圆
  bool = imagick_drawline([image handle],[starting x],[starting y],[ending x],[ending y ]) Draw a line
bool = imagick_drawpoint([image handle],[x coordinate ],[ycoordinate ]) Draw a point
bool = imagick_setfillcolor([image handle],[color vlaue]) Set fill color
bool = imagick_setfillopacity([image handle],[opactiy]) Set opacity
Quality enhancement class bool = imagick_rotate([image handle] ,[degrees]) Set the angle of the rotated image
bool = imagick_shear([image handle],[x coordinate],[y coordinate]) rotation shear
bool = imagick_contrast([image handle],[contrast value] ) Increase or reduce image contrast
bool = imagick_equalize( [image handle]) Color uniformity
bool = imagick_gamma ([image handle],[gamma value 0.8 - 2.3]) Image GAMMA adjustment
bool = imagick_level([image handle],[gamma value 0.8 - 2.3]) Image GAMMA adjustment
bool = imagick_modulate([image handle],[modulate]) Adjust brightness, saturation, color
##bool = imagick_negate([image handle],[gray scale value])
bool = imagick_normalize([image handle])
bool = imagick_border([image handle],[ x starting position of border ],[y starting position of border ],[width of border],[height of border])
UN KNOW USE imagick_frame
bool = imagick_raise([image handle],[ x starting position of border ] ,[ y starting position of border ],[ width of border],[ height of border],[raise non-zero])
bool = imagick_charcoal([image handle],[the radius of pixel neighborhood],[the standard deviation of the Gaussian, in pixels])
bool = imagick_implode([image handle],[define the extent of the implosion])
= imagick_oilpaint([image handle],[the radius of the circular neighborhood]
)Oil painting effect
= imagick_solarize([image handle],[define the extent of solarization - this value is between 0 and MaxRGB])Reverse exposure
= imagick_swirl([ image handle],[define the tightness of the swirling effect ]) 旋涡
  bool = imagick_wave([image handle],[the amplitude of the wave],[the frequency of the wave]) 水波纹
图片滤镜类 bool = imagick_blur([image handle],[the radius of the Gaussian, in 
pixels, not counter the center pixel],[the standard deviation of the 
Gaussian, in pixels])
模糊
  bool = imagick_despeckle([image handle]) 平滑聚焦图象
  bool = imagick_edge([image handle],[the radius of the pixel neighbor- hood; using 0 will cause a suitable radius to be selected for you]) 边缘锐化
  bool = imagick_emboss([image handle],[the radius of the pixel neighbor- 
hood],[the standard deviation of the Gaussian, in pixels])
浮雕效果
  bool = imagick_enhance([image handle]) 图象增强
  bool = imagick_gaussianblur([image handle],[he radius of the Gaussian, in pixels, not counting the center pixel; using 0 will cause a suitable radius to be selected for you],[the standard deviation of the Gaussian, in pixels]) 高斯模糊
  bool = imagick_medianfilter([image handle],[the radius of the pixel neighbor-hood]) 平滑过滤图象
  bool = imagick_motionblur([image handle],[the radius of the Gaussian, in 
pixels, not counter the center pixel],[the standard deviation of the 
Gaussian, in pixels],[apply the effect along this angle])
动感模糊
  bool = imagick_reducenoise([image handle],[the radius of the pixel neighborhood]) 降噪
  bool = imagick_shade 阴影
  bool = imagick_sharpen 锐化
  bool = imagick_spread 发散
  bool = imagick_threshold 临界值
  bool = imagick_unsharpmask unsharpmask锐化
  UN KNOW USE bool = imagick_flatten  
图片列表类 bool = imagick_next  
  bool = imagick_prev  
  bool = imagick_first  
  bool = imagick_goto  
  bool = imagick_getlistsize  
  bool = imagick_getlistindex  
  bool = imagick_getimagefromlist  
  bool = imagick_pushlist  
  bool = imagick_poplist  
图片变形类 bool = imagick_chop  
  bool = imagick_crop([image handle],[x starting position of border],[y starting position of border],[width of border],[height of border]) 从图片上截取
  bool = imagick_flip ([image handle]) 图象翻转
  bool = imagick_flop 左右转换
  bool = imagick_roll  
  bool = imagick_profile  
  bool = imagick_rgbtransform 色彩变更
  bool = imagick_transformrgb 色彩变更
  bool = imagick_mosaic  
  bool = imagick_transparent([image handle],[color value]) 设置指定颜色成为透明色
图片量子化 bool = imagick_ordereddither([image handle])  
图片合成类 bool = imagick_composite Image fusion
Image attribute setting bool = imagick_set_image_comment([ image handle],[the comment to set in the image]) Set some parameters of the image
bool = imagick_set_image_quality([image handle],[quality value]) Set the quality of the image
Handle destruction class bool = imagick_destroyhandle ([image handle]) Kill the specified image handle
Compatible function imagick_read => ; imagick_readimage
imagick_free => imagick_destroyhandle
Abandoned function imagick_add_resource
imagick_list_magickinfo
imagick_new
imagick_init
imagick_copy_sample
imagick_copy_resize
imagick_copy_crop
##imagick_copy_shear
imagick_copy_rotate
imagick_copy_morph
imagick_dump

Related recommendations:

In-depth analysis of ImageMagick command execution vulnerability

PHP’s ImageMagick use;


The above is the detailed content of Chinese documentation for PHP functions calling ImageMagick. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP's Purpose: Building Dynamic WebsitesPHP's Purpose: Building Dynamic WebsitesApr 15, 2025 am 12:18 AM

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

PHP: Handling Databases and Server-Side LogicPHP: Handling Databases and Server-Side LogicApr 15, 2025 am 12:15 AM

PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

How do you prevent SQL Injection in PHP? (Prepared statements, PDO)How do you prevent SQL Injection in PHP? (Prepared statements, PDO)Apr 15, 2025 am 12:15 AM

Using preprocessing statements and PDO in PHP can effectively prevent SQL injection attacks. 1) Use PDO to connect to the database and set the error mode. 2) Create preprocessing statements through the prepare method and pass data using placeholders and execute methods. 3) Process query results and ensure the security and performance of the code.

PHP and Python: Code Examples and ComparisonPHP and Python: Code Examples and ComparisonApr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP in Action: Real-World Examples and ApplicationsPHP in Action: Real-World Examples and ApplicationsApr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP: Creating Interactive Web Content with EasePHP: Creating Interactive Web Content with EaseApr 14, 2025 am 12:15 AM

PHP makes it easy to create interactive web content. 1) Dynamically generate content by embedding HTML and display it in real time based on user input or database data. 2) Process form submission and generate dynamic output to ensure that htmlspecialchars is used to prevent XSS. 3) Use MySQL to create a user registration system, and use password_hash and preprocessing statements to enhance security. Mastering these techniques will improve the efficiency of web development.

PHP and Python: Comparing Two Popular Programming LanguagesPHP and Python: Comparing Two Popular Programming LanguagesApr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

The Enduring Relevance of PHP: Is It Still Alive?The Enduring Relevance of PHP: Is It Still Alive?Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.