| | |
About image mirroring using php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi to all,
I would like to give a feature for users while they are uploading their pictures. Suppose if the user uploaded a picture, then the user has facility to change the uploaded picture into horizontal mirroring and vertical mirroring. Once the user changed the image to his wishes then the image would be saved into server.
Kindly anyone suggest me how to mirroring the image using php in serverside.
Thanku in advance.
I would like to give a feature for users while they are uploading their pictures. Suppose if the user uploaded a picture, then the user has facility to change the uploaded picture into horizontal mirroring and vertical mirroring. Once the user changed the image to his wishes then the image would be saved into server.
Kindly anyone suggest me how to mirroring the image using php in serverside.
Thanku in advance.
HI mahe4us,
Are you using GD or Imagemagick?
With Imagemagick you can use the -flip option to get the mirror image. heres an article on imagemagick for php: http://www.sitepoint.com/article/dyn...es-imagemagick
If you're using GD, unfortunately there is no function to get the mirror image using GD functions in PHP.
The only way I can think of is to:
1) Get each color of the image pixels (using: imagecolorat() function. http://www.php.net/manual/en/function.imagecolorat.php)
2) Place all the colors of the pixels in a corresponding Array.
3) Manipulate the Array using the Array functions. http://www.php.net/array. (eg: To get the mirror image along the right side of the image, then reverse all array values from left to right.)
4) Create the mirror image from the manipulated array of colors by drawing each pixel. (http://www.php.net/manual/en/function.imagesetpixel.php)
It would probably won't be the most efficient solution..
Are you using GD or Imagemagick?
With Imagemagick you can use the -flip option to get the mirror image. heres an article on imagemagick for php: http://www.sitepoint.com/article/dyn...es-imagemagick
If you're using GD, unfortunately there is no function to get the mirror image using GD functions in PHP.
The only way I can think of is to:
1) Get each color of the image pixels (using: imagecolorat() function. http://www.php.net/manual/en/function.imagecolorat.php)
2) Place all the colors of the pixels in a corresponding Array.
3) Manipulate the Array using the Array functions. http://www.php.net/array. (eg: To get the mirror image along the right side of the image, then reverse all array values from left to right.)
4) Create the mirror image from the manipulated array of colors by drawing each pixel. (http://www.php.net/manual/en/function.imagesetpixel.php)
It would probably won't be the most efficient solution..
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Hi Digital-Ether,
Glad to meet you once again with my query. I gothrough the sites given by you . It is very effective. Apart from that, somebody told me to mirroring,cropping,rotating the images via OCR programs. That means OCR programs are written in VC++ . Inputs are given through php and the processing are held in vc++ in the server and the return result are get output at php pages.
image rendering
images
PHP -------->VC++(OCR PROGRAMS)---------> output at brower(PHP)
This is the concept i want to tell you. Have you any idea about this.....
Is this possible ????
I expecting your reply........
Glad to meet you once again with my query. I gothrough the sites given by you . It is very effective. Apart from that, somebody told me to mirroring,cropping,rotating the images via OCR programs. That means OCR programs are written in VC++ . Inputs are given through php and the processing are held in vc++ in the server and the return result are get output at php pages.
image rendering
images
PHP -------->VC++(OCR PROGRAMS)---------> output at brower(PHP)
This is the concept i want to tell you. Have you any idea about this.....
Is this possible ????
I expecting your reply........
Its seems that OCR (Optical Character Recognition) programs are designed specifically for recognizing text/characters in Image files, not transforming images.
I would think that the GD lib (written in C++ also) or Imagemagick would be more suited for manipulating images than an OCR program since its designed specifically for manipulating images. They are easier to use since PHP extensions have been developed for both.
If the OCR program has the mirror image function however, it may be the better one to use. who knows..
If you go with using an OCR then, you'd have to install the OCR program on your server however.
I think you can then access it via PHP by executing commands through the system() or exec() function or one of the like.
I would think that the GD lib (written in C++ also) or Imagemagick would be more suited for manipulating images than an OCR program since its designed specifically for manipulating images. They are easier to use since PHP extensions have been developed for both.
If the OCR program has the mirror image function however, it may be the better one to use. who knows..
If you go with using an OCR then, you'd have to install the OCR program on your server however.
I think you can then access it via PHP by executing commands through the system() or exec() function or one of the like.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Hi Digital-Ether,
Thankyou for your kind reply. I have realised that imagemagick is better than OCR programs and it is easy to manipulate images in a better way. I have some doubts regarding imagemagick php extensions. I have succesfully installed imagemagick in my windows system. Now iam trying to install magickwand for php. But it has some difficulty to install.
Please gothrough the below URL...
http://www.imagemagick.org/discourse...hlight=install
In the above URL they explained how to install imagemagick and magickwand for php. I have understood imagemagick installation but magickwand is somewhat difficult. If you have get any ideas....kindly suggest me how to install magickwand dll files in server after imagemagick sucessfully installed.
Expecting your great reply...
Thankyou for your kind reply. I have realised that imagemagick is better than OCR programs and it is easy to manipulate images in a better way. I have some doubts regarding imagemagick php extensions. I have succesfully installed imagemagick in my windows system. Now iam trying to install magickwand for php. But it has some difficulty to install.
Please gothrough the below URL...
http://www.imagemagick.org/discourse...hlight=install
In the above URL they explained how to install imagemagick and magickwand for php. I have understood imagemagick installation but magickwand is somewhat difficult. If you have get any ideas....kindly suggest me how to install magickwand dll files in server after imagemagick sucessfully installed.
Expecting your great reply...
![]() |
Similar Threads
- retrieving image from mysql database using php (PHP)
- Image link in an email from php (PHP)
- PHP Members HELP W/DB Images (PHP)
- php 4.3.3 and gd (PHP)
- Random text display with image, link (PHP)
Other Threads in the PHP Forum
- Previous Thread: Trying to set up mirror service for web site.
- Next Thread: Problem with PhP MySql Ajax dropdown code
| Thread Tools | Search this Thread |
# address apache api array autoincrement beginner binary broken cakephp checkbox class clean cms code countingeverycharactersfromastring crack cron curl database date decode dehasher directory display dissertation dynamic echo email error fairness file files folder form forms function functions google href htaccess html image include incode insert ip javascript joomla legislation limit link login mail masterthesis match menu method mlm multiple mysql newsletters oop pagerank paypal pdf persist php play protocol query question radio random remote root script search server sessions simple sms soap source space spam sql support! syntax system table tutorial update upload url validator variable video web youtube






