Announcement

Collapse
No announcement yet.

Reduce Number of Unused Bytes in Palette

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Reduce Number of Unused Bytes in Palette

    Does anybody know why IV save GIFs only with palettes containing 256, 16 and 2 colors, when it could contain 256, 128, 64, 32, 16, 8, 4, 2 colors?

    Let's say I have image with 32 colors, but IV save it with 256 color palette, so the palette is mostly empty:
    Click image for larger version

Name:	flag32_IV.gif
Views:	2
Size:	1.4 KB
ID:	84648
    It's file size is 1401 bytes.
    IV has Show HEX View function (F3 key) , which show 32 colors in the palette (from position 13=0Dh) and the rest are 0's.
    If I delete (in some HEX editor) those (256-32)x3 bytes, and change byte on the position 10(0Ah) from F7 to C4 (Color Resolution and Size of Global Color Table bits), I have the same image, but smaller:
    Click image for larger version

Name:	flag32_IV_binary_edited.gif
Views:	2
Size:	729 Bytes
ID:	84647
    It's file size is 729 bytes.
    I suppose that this format is O.K. and in case of small pictures it has sense to use the appropriate size of palette. Is there any reason why IV does not use it?
    Last edited by bflmpsvz; 10.01.2014, 08:08 PM.

    #2
    I don't know the answer to that, but why not use PNG which is even smaller?

    I saved your using the PNGOUT plugin and it's only 615 bytes.
    Attached Files
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      I discovered this feature when I prepared frames for animated GIF. So that's why.

      And the Thread name : Reducing Number of Colours in Palette is not right, because I do not want to reduce Number of Colours, but number of unused bytes.
      Last edited by bflmpsvz; 13.01.2014, 01:49 PM.

      Comment

      Working...
      X