Tag Archives | image manipulation
Edge detection with PHP

Edge detection with PHP

We do some example with this image : http://static.asiawebdirect.com/m/bangkok/portals/vietnam/homepage/hanoi/pagePropertiesImage/hanoi-guide.jpg Method 1: Online demo: Method 2: Use imagefilter: Online demo: Method 3: Online demo: Method 4: use imageconvolution Online demo: Please comment the mothod you prefer.

Read full story Comments { 0 }
How to create transparent image with PHP

How to create transparent image with PHP

Method 1: use imagecolorallocatealpha and imagesavealpha Online demo: Method 2: use imagecolortransparent Online demo:

Read full story Comments { 0 }
BMP file structure analysis by PHP – Part 2

BMP file structure analysis by PHP – Part 2

Part 2: The 16-bit per pixel (16bpp) BMP The bitmap has a maximum of 2^16 colors. if the compression field of the bitmap file is set to bi_rgb, the palette (color table) field does not contain any entries. each word in the bitmap array represents a single pixel. the relative intensities of red, green, and […]

Read full story Comments { 0 }
PHP function to parse BMP header

PHP function to parse BMP header

Read first: BMP file structure analysis by PHP Example 1: 5-5-5 16-bit Result: Example 2: 5-6-5 16-bit Result: Example 3: 4-4-4 16-bit Result:

Read full story Comments { 1 }
BMP file structure analysis by PHP

BMP file structure analysis by PHP

Part 1: overview BMP file structure (Reference: http://en.wikipedia.org/wiki/BMP_file_format#File_structure) The bitmap image file consists of fixed-size structures (headers) as well as variable-size structures appearing in a predetermined sequence. Many different versions of some of these structures can appear in the file, due to the long evolution of this file format. (Source of picture: WikiPedia.org) Referring to […]

Read full story Comments { 1 }
PHP OCR with GD – Example 2

PHP OCR with GD – Example 2

Read this article first: Simple PHP OCR with GD Step 1: Goto http://chotot.vn we can see many pictures contain telephone number. We find that these pictures that contain a maximum of 11 digits, and have the same font, same size. We use 3 pictures contain all number from 0 to 9: http://www.chotot.vn/pg/0Njg2ODY2AAAAAAAAAAAAAJl+piriBW+L/QY=.gif http://www.chotot.vn/pg/0Njg3NTA0AAAAAAAAAAAAALuxb72u/MXOO9k=.gif http://www.chotot.vn/pg/0Njg3NTA3AAAAAAAAAAAAACXjI28Lu8wq5LCY.gif Step […]

Read full story Comments { 0 }
PHP function: Image Resize and Crop

PHP function: Image Resize and Crop

This function support crop and resize JPEG, GIF, PNG image. Example of usage: online demo

Read full story Comments { 0 }
PHP: Crop image function (part 2)

PHP: Crop image function (part 2)

Read first: PHP: Crop image function We can save to new file: Online demo We get the result: http://www.demo.tutorialspots.com/crop/logo.png Now, we can crop image on the fly: Source code of file crop.php Example 1: PHP logo Source picture http://www.demo.tutorialspots.com/crop/crop.php?src=http://static.php.net/www.php.net/images/php.gif&w=80&h=40&x=20&y=13 we get the result: Example 2: Source picture http://incloak.com/images/proxylist_port_4084543.gif http://www.demo.tutorialspots.com/crop/crop.php?w=5&h=8&x=0&y=3&src=http://incloak.com/images/proxylist_port_4084543.gif we get the result: Continuing…

Read full story Comments { 0 }
PHP: Crop image function

PHP: Crop image function

See our logo Step 1: detect filetype (gif, jpeg, png) use function getimagesize result: array(6) { [0]=> int(300) [1]=> int(107) [2]=> int(3) [3]=> string(24) “width=”300″ height=”107″” [“bits”]=> int(8) [“mime”]=> string(9) “image/png” } Note: Returns a array with 6 elements. The 0 index is the width of the image in pixels. The 1 index is the […]

Read full story Comments { 0 }