Re: [PHP] image* Functions' Memory Usage
I recently made two commercial sites that used both GD and Imagick and i can share some wisdom i got from those projects. (both projects were "card" generators where users made their custom cards and but one had a fixed picture and users could add text and the other one allowed users to add their own picture with text) # Some functions of the GD library are VERY memory intensive. For example the image resizing. The resizing process is calling three functions to work and two of them are holding very large amounts of data within them. (the original image and the new image area you are going to put the resized image into, and then the 3rd functions resizes the image) # Basic GD library functions can be quite fast (and most if not all Imagick functions are fast if the image isn't too big) # Speed of both options are always affected by the size of the image being used. (Size in bytes, a 10x15 print quality card generated with a user selected image + text can take up to 30 seconds to generate) And yes thats an annoying generator to debug. # If you are going beyond simple things like adding text onto an image i recommend going with Imagick. # Imagick is a great system to use if you learn all the command lines and combinations, far superior to GD in many ways. # Complex Imagick functions (that works with all possible outcomes) can be VERY slow. # If you have the choice of running Imagick from the command line (installed onto the linux system) or running the Imagick PHPlib, go with the PHP library one (even though it looks like more overhead in code) since error reporting with the command line is close to none. # If you have the choice of the images being generated later (ie. by an admin of the system), go with that path always. (one of my systems does that and the other doesn't) and the problems with the end users on the image generating step are very hard to debug, since they usually describe the problems very badly. Hope this helps some. - Ólafur Waage [EMAIL PROTECTED] 2008/1/4, Casey <[EMAIL PROTECTED]>: > Greetings, list. > > I have a web application that generates PNG images that are thousands > of pixels high by thousands of pixels wide (using imagepng, etc.). > > The problem is this takes way too much memory, and the rest of the > site becomes too slow. > > I'm working on something to cache the images, but some suggestions in > the meantime would be great. > > Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much. > > - Casey > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image* Functions' Memory Usage
"Casey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Jan 4, 2008, at 9:54 AM, "Daniel Brown" <[EMAIL PROTECTED]> wrote: On Jan 4, 2008 12:46 PM, Casey <[EMAIL PROTECTED]> wrote: Greetings, list. I have a web application that generates PNG images that are thousands of pixels high by thousands of pixels wide (using imagepng, etc.). The problem is this takes way too much memory, and the rest of the site becomes too slow. I'm working on something to cache the images, but some suggestions in the meantime would be great. Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much. It depends on what you are trying to do with the images. Are you randomly-generating data to create patterns, or are you (*gasp*) converting small images into [very pixelized] larger ones? -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. I'm laying many different other (smaller) images over each other at various positions. (I know HTML/CSS and SVG could do this with less trouble, but that would give away my secrets by just viewing the source.) -Casey Have you considered obscuficated javascript? It's not very hard to have JS add a few images and rotate/move them where ever you want. Plus there's not too many people that could make much sense from clear plain JS anyway. Flash is also a good bet. - Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image* Functions' Memory Usage
On Jan 4, 2008 12:59 PM, Casey <[EMAIL PROTECTED]> wrote: [snip] > I'm laying many different other (smaller) images over each other at > various positions. (I know HTML/CSS and SVG could do this with less > trouble, but that would give away my secrets by just viewing the > source.) Okay, so kind of like a mural, but for a different purpose. For size, Flash would be your best bet, because everything is converted to a Vector but getting PHP to output to that is beyond my scope of knowledge, to be honest. I would probably do things with GD or ImageMagick, as you've already hinted. NetPBM might even be a viable alternate route. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image* Functions' Memory Usage
On Jan 4, 2008, at 9:54 AM, "Daniel Brown" <[EMAIL PROTECTED]> wrote: On Jan 4, 2008 12:46 PM, Casey <[EMAIL PROTECTED]> wrote: Greetings, list. I have a web application that generates PNG images that are thousands of pixels high by thousands of pixels wide (using imagepng, etc.). The problem is this takes way too much memory, and the rest of the site becomes too slow. I'm working on something to cache the images, but some suggestions in the meantime would be great. Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much. It depends on what you are trying to do with the images. Are you randomly-generating data to create patterns, or are you (*gasp*) converting small images into [very pixelized] larger ones? -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. I'm laying many different other (smaller) images over each other at various positions. (I know HTML/CSS and SVG could do this with less trouble, but that would give away my secrets by just viewing the source.) -Casey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image* Functions' Memory Usage
On Jan 4, 2008 12:46 PM, Casey <[EMAIL PROTECTED]> wrote: > Greetings, list. > > I have a web application that generates PNG images that are thousands > of pixels high by thousands of pixels wide (using imagepng, etc.). > > The problem is this takes way too much memory, and the rest of the > site becomes too slow. > > I'm working on something to cache the images, but some suggestions in > the meantime would be great. > > Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much. It depends on what you are trying to do with the images. Are you randomly-generating data to create patterns, or are you (*gasp*) converting small images into [very pixelized] larger ones? -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image* Functions' Memory Usage
Greetings, list. I have a web application that generates PNG images that are thousands of pixels high by thousands of pixels wide (using imagepng, etc.). The problem is this takes way too much memory, and the rest of the site becomes too slow. I'm working on something to cache the images, but some suggestions in the meantime would be great. Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much. - Casey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php