I got large animations with over 500 frames rendered where convert was killed by my system because of memory consumption. I would rather use gifsicle ( ) instead of convert. BTW - there is no advantage to this method if the image will appear more than ONCE in the page because you will be transmitting the same data multiple times as opposed to just once (most browsers realize that already downloaded data that has multiple references only requires one HTTP call).Ĭonsider using this method if you want to make a single PHP program that outputs both text and an image AND you want to make only on HTTP call. JPEG files aren't really suggested (usually, these files are too large). This should work for other image types as well, such as PNG. Browsers where this syntax worked that I tested are the following: Note this is useful for very small images only (as most browsers appear to have a limitation on the size of HTML element data of 1024). If you don't start it with this, it won't work in a lot of the different browsers I tested (such as IE). Note also that I start the URI with "/-/" before the rest of the data scheme spec. A number of browsers support this format from some of my tests and would be an interesting way of removing overhead from multiple HTTP connections.
Gifsicle too many colors how to#
I've been playing around with the "data" URL scheme as proposed by RFC 2397 which states how to perform inline, bas64 encoded images.
Use either the rgboutput or the rgboutput_truecolor functions, depending on your GD version/style of image you're working with: The rgb2gif utility included in giflib can be used for fast and easy gif output with any version of GD