[Developer Shed Network] Server Side - PHP - Configuration Manipulation With PHP Config
Basic Image Manipulation PHP
-
Upload
prodigyview -
Category
Technology
-
view
1.585 -
download
3
description
Transcript of Basic Image Manipulation PHP
![Page 1: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/1.jpg)
Basic Image Creation and Manipulation
![Page 2: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/2.jpg)
OverviewObjective
Learn the basics of creating, converting, and acquiring information on images.
Requirements
Installed version of Imagick
Estimated Time
10 minutes
www.prodigyview.com
![Page 3: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/3.jpg)
Follow Along With A Code Example
1. Download a copy of the example code at www.prodigyview.com/source.
2.Install the system in an environment you feel comfortable testing in.
3.Proceed to examples/avi/ImageBasics.php
http://www.prodigyview.com
![Page 4: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/4.jpg)
Drawing A RectangleThe most basic image we can draw is a rectangle. The rectangle
1. Set the image width, height, and color.
2.Returns the full path location of the image
3. Remove part of the image path 4. Display the image
![Page 5: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/5.jpg)
RectangleThe rectangle that will be drawn should like these two.
1, The location the image was saved
2. The image displayed
![Page 6: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/6.jpg)
EllipseA more complex shape we can drawn is an ellipse, which is a circular shape.
1. Ellipse Width 2. Ellipse Height 3. Ellipse Color
4. The location the ellipse was saved
![Page 7: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/7.jpg)
EllipseThe ellipses that were drawn from the previous code should look like this
![Page 8: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/8.jpg)
Width and HeightCommon attributes of an image is the size and the width.
1. The location of the image on file file system
2. Get the image width 3. Get the image height
www.prodigyview.com
![Page 9: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/9.jpg)
Convert Image FormatThe last thing we are going to do is convert an image’s format. Converting the formats will try to keep the image close to the quality of the original.
1. The location of the current image 2. The format to convert it to
3. The location of the file converted file
![Page 11: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/11.jpg)
Review
1. Create a rectangular image with PVImage::drawImage() method
2. Draw an ellipse with PVImage::drawEllipse()
3. Get the height of an image with PVImage::getImageHeight()
4. Get the width of an image with PVImage::getImageWidth()
5. Convert image formats with PVImage::convertImageFormat()
www.prodigyview.com
![Page 12: Basic Image Manipulation PHP](https://reader033.fdocuments.in/reader033/viewer/2022051013/547e02ecb4af9fd9058b469c/html5/thumbnails/12.jpg)
API ReferenceFor a better understanding of the image manipulation, check out the api at the two links below.
PVImage
www.prodigyview.com
More Tutorials
For more tutorials, please visit:
http://www.prodigyview.com/tutorials