Regardless of the provided settings, GD doesn't produce the most optimized png images.
GIF to me is like IE6, dead.
I agree completely... Why .png isn't supported is beyond me. I would say that for most intent and purposes, .png is better than .jpg. I know it's not better for every situation, but on the Web, I find that .png tends to work out better.It's more than just transparency... Forcing all images to JPEG means you lose not only the ability to have transparency, but you also don't have the ability to have lossless images (that would be the biggest thing for me) and you can't have animated images (not that I would EVER want them, but I'm sure some might).
I agree this should be fixed, but I just wanted to point out the jpgs are almost always superior for photographic data; smaller filesize for the same—as detectable by the human eye—image quality.I agree completely... Why .png isn't supported is beyond me. I would say that for most intent and purposes, .png is better than .jpg. I know it's not better for every situation, but on the Web, I find that .png tends to work out better.
I guess it wasn't this thread I posted it in, but the difference in file size between JPG and PNG (for images produced by GD) was astronomical. 5k vs 45k sort of thing. I'll play with it again to see if I can get better results.I agree completely... Why .png isn't supported is beyond me. I would say that for most intent and purposes, .png is better than .jpg. I know it's not better for every situation, but on the Web, I find that .png tends to work out better.
quality (compression) / filters within imagepng doesn't help at all?I guess it wasn't this thread I posted it in, but the difference in file size between JPG and PNG (for images produced by GD) was astronomical. 5k vs 45k sort of thing. I'll play with it again to see if I can get better results.
PNG_NO_FILTER - Disable all filters
PNG_FILTER_NONE - the scanline is transmitted unmodified; it is only necessary to insert a filter type byte before the data.
PNG_FILTER_SUB - transmits the difference between each byte and the value of the corresponding byte of the prior pixel.
PNG_FILTER_UP - just like the Sub filter except that the pixel immediately above the current pixel, rather than just to its left, is used as the predictor.
PNG_FILTER_AVG - uses the average of the two neighbouring pixels (left and above) to predict the value of a pixel.
PNG_FILTER_PAETH - computes a simple linear function of the three neighbouring pixels (left, above, upper left), then chooses as predictor the neighboring pixel closest to the computed value.
PNG_ALL_FILTERS - Enables all filters.
Already suggested this:quality (compression) / filters within imagepng doesn't help at all?
<snip>
It depends on the context of the image for sure, but a 5k vs. 45k size makes me think something is wrong regardless of the image.I guess it wasn't this thread I posted it in, but the difference in file size between JPG and PNG (for images produced by GD) was astronomical. 5k vs 45k sort of thing. I'll play with it again to see if I can get better results.
Did you handle these through GD? In general my experience matches yours: (using good software) PNG tends to be slightly larger, if not a similar size, as JPEG. But I think Mike was saying that GD handles PNG's poorly and outputs extremely large filesizes relative to JPEG's. In other words, it's GD's fault.It depends on the context of the image for sure, but a 5k vs. 45k size makes me think something is wrong regardless of the image.
I just did a couple tests on file sizes...
The image I'm using as my avatar here:
JPEG (quality = 100): 4.8k
JPEG (quality = 60): 2.2k
PNG (24-bit): 11.1k
PNG (8-bit): 5.4k
GIF: 6k
Line art/drawings tend to be better suited for PNG (and what you would probably use some transparency for anyway).
If I used a 75x75 version of my company logo (with transparency where supported) the size is as follows:
JPEG (quality = 100): 3.6k
JPEG (quality = 60): 1.9k
PNG (24-bit): 1.3k
PNG (8-bit): 0.8k
GIF: 0.8k
So depending on the context of the image, some formats are more efficient than others, but some image that comes out being 9x larger as PNG vs. JPEG seems odd to me.
We use essential cookies to make this site work, and optional cookies to enhance your experience.