D
D
Dmitry Zarezenko2010-11-22 15:19:28
JPEG
Dmitry Zarezenko, 2010-11-22 15:19:28

Does it make sense to convert all the images on the site to PNG?

Imagine a situation


Need to increase website traffic. There was such offer: to convert all images on a resource in the PNG format. The resource is still a small social network with about 2500 visits per day. It contains about 3,500 thousand profiles and, of course, the main images are their photographs, almost all in JPG format.

Question


Does it make sense to convert all images to PNG format and in the future, when uploading images, also convert them to PNG?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
M
MT, 2010-11-22
@dzarezenko

In your case, it makes sense to configure server-side HTTP headers to cache images in the browser for several days (sometimes even a month is recommended). At the htaccess level, this can be done like this:
ExpiresActive on
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000

A
ahromenko, 2010-11-22
@ahromenko

I don't think it's necessary. PNG photos are weird. In PNG, only icons, small design elements.

M
MT, 2010-11-22
@MTonly

1. The principle of JPEG compression is based on dividing the image into squares of 8×8 pixels and filling these squares with gradients . Suitable for photographs (where by definition there are a lot of gradients and few sharp objects) and not suitable for line art such as diagrams (for clarity, you should try to imagine what becomes of, say, a one-pixel line when you try to represent it as an 8x8 gradient; it is also useful to consider such a JPEG image at high magnification).
2. The principle of GIF and PNG-8 compression (not to be confused with PNG - 24) is based on narrowing the color palette to a minimum sufficient for a more or less correct display of the image. By narrowing the palette, each color variant can be encoded with a smaller number of bytes, and this (in addition to archiving algorithms) is what compression is achieved. The maximum number of shades is 256. Accordingly, GIF and PNG-8 are well suited for subjectively lossless (each pixel is encoded) compression of line images with solid areas and a small number of shades (logos, graphs, diagrams, etc.) and is NOT suitable for the vast majority of photographic images (in photographs, the number of shades is usually much more than 256, and if not more, then the file size is unreasonably large, since GIF / PNG-8 honestly encode each pixel of the image).
3. PNG-24(not to be confused with PNG- 8 ) - compression is generally lossless. Essentially a specialized archiver for images. Accordingly, the volume of the output file is the largest and usually much larger than that of GIF / PNG-8, as well as JPEG. It is usually used either when lossless compression is required, or when translucency is needed, or when preserving extended solid areas and / or unidirectional gradients (such gradients compresses more efficiently than GIF / PNG-8).

K
kekekeks, 2010-11-22
@kekekeks

What about the meaning? The image is already compressed with losses, saving to PNG will not restore them. But there will be more space for pictures. So it goes.

M
marcus, 2010-11-22
@marcus

Formats should be used as intended. PNG is for storing transparent and translucent images, Jpeg for storing photos, and GIF for storing the most primitive graphics. The compression algorithms of each of the formats are sharpened specifically for their needs. If you save a photo in PNG, and an icon in jpeg, their size will increase significantly. So your optimization will result in huge brakes ;-)

G
georgethegreat, 2010-11-22
@georgthegreat

If the picture was compressed by JPEG, then, due to distortion, PNG will compress very badly.
If you have uncompressed sources, then it makes sense to see which encoder works more efficiently on a particular card.
Photos will compress JPEG much better, logos, gradients - PNG.

V
Vasya_Sh, 2010-11-22
@Vasya_Sh

Photos are in JPEG, everything else is in PNG.
GIF is outdated.

B
bdmalex, 2010-11-22
@bdmalex

Need to increase site traffic . There was such offer: to convert all images on a resource in the PNG format.
Long tried to understand why you need it. The traffic will not increasefrom the fact that all the pictures in PNG on your site will beIf there is a desire to "save on iron resources",
then the translation of pictures is one of the options for saving, although in my opinion it is completely incomprehensible.
Attendance of 2500 visits per day is the load of the GVA server with 512M of RAM, which can be bought for 450-500 rubles per month. And I think this config is enough for about 10,000 visits per day (if not more).
There will be problems with the resource - it's not a problem to switch to a higher tariff with 1GB of RAM and a more powerful processor for 850-900 rubles. Plus with such attendanceit makes sense to start thinking about monetizing the resource ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question