4 Ekim 2019 Cuma

Resim Formatları - PNG

Giriş
Fotoğraflar yerine dijital çizimler veya ekranda yakalanan resimler için daha uygun. Açıklaması şöyle.
"PNG images are saved using prediction. It is compressed by checking vertical or horizontal blocks of the same color to create prediction data. This is a lossless format.

PNG is not recommended for photographic content, as there is almost always no consistent blocks to compress. PNGs strength lie in flat color images. Line art, digital sketches, desktop or window screen shots etc are better off saved under this format"
Header
Açıklaması şöyle
a real PNG file always starts with the eight bytes 0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A (note that bytes 2 through 4 are the ASCII characters 'PNG', the rest of the header is binary data designed to detect the file being handled in ways that would result in data corruption
Sıkıştırma
PNG kayıpsız sıkıştırma (lossless compression) yapabiliyor.

Chunklar Nelerdir
IHDR, IDAT, IEND chunklarından oluşur.
File: result.png (334985 bytes)
  chunk IHDR at offset 0x0000c, length 13
    600 x 450 image, 24-bit RGB, non-interlaced
  chunk IDAT at offset 0x00025, length 65536
    zlib: deflated, 32K window, default compression
    row filters (0 none, 1 sub, 2 up, 3 avg, 4 paeth):
      1 4 4 4 4 4 4 4 1 4 4 4 4 4 4 4 1 4 4 4 4 4 4 4 4
      1 4 4 1 4 1 4 1 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1
      1 1 1 1 1 1 1 1 1 4 4 1 1 1 1 1 1 1 4 4 1 4 1 1 4
      4 4 4 4 4 1 4 4 4 4 4 4 4 1 4 4 4 4 4 4 4 (96 out of 450)
  chunk IDAT at offset 0x10031, length 65536
    row filters (0 none, 1 sub, 2 up, 3 avg, 4 paeth):
      1 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 1
      4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
      4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 1 4 4
      4 4 4 4 4 4 4 4 4 4 4 4 4 1 4 4 4 (188 out of 450)
...
  chunk IEND at offset 0x51c81, length 0
No errors detected in result.png (8 chunks, 58.6% compression).
Renk biti
PNG sadece RGB renk uzayını destekler. CMYK renk uzayını desteklemez.Açıklaması şöyle.
There is no support for CMYK or other unusual color spaces. Again, this is in the name of promoting portability. CMYK, in particular, is far too device-dependent to be useful as a portable image representation.
Kanal başına bir renk için 8 veya 24 bit kullanır.

Alpha
PNG alpha kanalını destekler.

Hiç yorum yok:

Yorum Gönder