Install and use ImageMagick with PHP

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
YBthebest

Re: Install and use ImageMagick with PHP

Post by YBthebest »

WoW! That's really nice of you ;)

You're a real expert :)

I'll tell you once I managed to do everything, my people will definitely be happy.

gOCR, here I come.

Thanks again!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Install and use ImageMagick with PHP

Post by anthony »

Bonzo wrote:something like a png which is not compressed.
PNG is compressed, just not lossy-compressed. It is an important distinction.

Better still if the intermediate image is only going to be read by another IM command you can use MIFF, with preserves more of the images meta-data than PNG but this is definably NOT compressed.

Better still use the special file format MPC
http://www.imagemagick.org/Usage/files/#mpc
whcih performs a straight memory dump of the image to disk.
This file can be directly 'paged' back into the memory the next "convert" run being performed by same script as the previous command. This means IM does not have to format, encode, or decode the intermediate image data, making the image read by the next program extremely quick.

However be sure to clean up both of the two files this image file format creates. You need to clean up intermediate files anyway so that is not a big problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
YBthebest

Re: Install and use ImageMagick with PHP

Post by YBthebest »

Wow, thanks for the info ;)

A last question. Is it possible to imagemagick a variable? Coz' actually I don't know the name of the file, somebody gives it to me, but through a variable? So can I /usr/bin lllblaba and then THEVARIABLE and then what I want to do on the image?
THEVARIABLE would be= image.jpg, for example!

Or can I imagemagick an external url? for example: google.com/image.jpg, and then I save the image on my own server?

Thanks :)
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Install and use ImageMagick with PHP

Post by Bonzo »

You can use a URL:

Code: Select all

exec("convert http://www.google.com/image.jpg ouput.jpg");
YBthebest

Re: Install and use ImageMagick with PHP

Post by YBthebest »

Euhm...okay thanks :)

But is it possible to do this:

exec("convert $url ouput.jpg");

?

Thanks ;)
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Install and use ImageMagick with PHP

Post by Bonzo »

Yes
Post Reply