Image file format: Difference between revisions

Content deleted Content added
m kindly added {{Original research}} as a top hat rather than adding one for each entirely unreferenced section
m grammar fixes citition error resolved
Line 11:
 
== Image file sizes ==
The size of raster image files is positively correlated with the number of pixels in the image and the color depth (bits per pixel). ImagesHowever, images can be compressed in various ways, however. A compression [[algorithm]] stores either an exact representation or an approximation of the original image in a smaller number of bytes, thatwhich can later be expanded back to its uncompressed form withusing a corresponding decompression algorithm. Images with the same number of pixels and color depth can have very different compressed file sizes. Considering exactly the same compression, number of pixels, and color depth for two images, different graphical complexity of the original images may also result in very different file sizes after compression due to the nature of compression algorithms. With some compression formats, images that are less complex may result in smaller compressed file sizes. This characteristic sometimes results in a smaller file size for some lossless formats than lossy formats. For example, graphically simple images (i.e., images with large continuous regions like line art or animation sequences) may be losslessly compressed into a GIF or PNG format and result in a smaller file size than a lossy JPEG format.
 
Images with the same number of pixels and color depth can still have very different compressed file sizes. When applying the same compression method to two images with identical pixel counts and color depth, variations in the graphical complexity of the images may lead to different file sizes after compression. In some formats, less complex images result in smaller compressed file sizes. This can even cause certain lossless formats to produce smaller files than lossy formats. For example, graphically simple images (i.e., those with large continuous regions, such as line art or animation sequences) may be losslessly compressed into GIF or PNG formats, resulting in smaller file sizes than when compressed into a lossy JPEG format.
For example, a 640{{resx}}480 pixel image with 24-bit color would occupy almost a megabyte of space:
 
For exampleinstance, a 640{{resx}}480640 × 480 pixel image with 24-bit color would occupy almost aone megabyte of space:
:640{{resx}}480{{resx}}24 = 7,372,800 bits = 921,600 bytes = 900 [[KiB]]
 
:640{{resx}} × 480{{resx}} × 24 = 7,372,800  bits = 921,600  bytes = 900 [[ KiB]]
With vector images, the file size increases only with the addition of more vectors.
 
In contrast, the size of vector images increases only with the addition of more vectors.<ref>{{Cite web |last=zaryab |first=zaryab |title=How to Resize Images Easily Without Losing Quality: A Complete Guide |url=https://medium.com/@sark60362/how-to-resize-images-easily-without-losing-quality-a-complete-guide-247b2a874914 |url-status=live |archive-url=https://medium.com/@sark60362/how-to-resize-images-easily-without-losing-quality-a-complete-guide-247b2a874914 |archive-date=Aug 10, 2025 |access-date=Aug 10, 2025 |website=medium .com}}</ref>
 
== Image file compression ==