Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 33

Thread: About Palette files

  1. #1
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default About Palette files

    Of course the focus is on working in fullcolour mode, but there is enough material which is offered, or can be represented in a lower resolution.
    The first lower step means 8 bits, so a maximum of 256 different colours.
    Each colour is represented by values of Red - Green - Blue, each value with a range of 0-255.
    Such a palette can be easily saved as a simple ascii file with on each line the three RGB values.

    0 0 0
    24 0 8
    56 16 24
    64 16 24
    80 24 32
    etc.

    IrfanView does this too, when 'exporting a palette'. It writes a *.PAL file.
    This means, that it's possible to build a library of palettes.
    One could open pic1 and import the .pal-file of pic2.
    So the palette can be a tool of modulation of the picture, like the Swap Colors option.
    Not by controlling some sliders, but as a switch.

    A first, random, collection of 122 palettes can be found here

    IrfanView is following the PSP format when writing a .PAL file, which means an extra header on top
    of the list of values:

    JASC-PAL
    0100
    256

    Other applications like fractal generators do save such a palette value list as well, often as a .MAP extension.
    But without this extra header. I've made a MAP2PAL batch converter.

    Some more sets : Pals 1 and Pals 2

    For the survey, make the IV subdirectory 'palettes' to extract the pal-sets to.
    Last edited by Sam_Zen; 18.02.2008 at 03:06 AM. Reason: other format
    0.6180339887
    Rest In Peace, Sam!

  2. #2
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default Palette viewer

    Save this bitmap, and it will directly show the new loaded palette in its right order.


    To avoid possible modifications or resizing during the save process, the ZIP can be found here.
    Last edited by Sam_Zen; 18.02.2008 at 03:07 AM. Reason: other format
    0.6180339887
    Rest In Peace, Sam!

  3. #3
    Moderator Laurent's Avatar
    Join Date
    May 2007
    Location
    Brussels, Belgium
    Posts
    882
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP3
    CPU Cores
    2

    Default

    Hi Sam_Zen,

    I did it and loaded chroma.pal (Image / Palette / Import). Here is the result. Is it what I should get?

    Laurent
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	chroma.jpg 
Views:	571 
Size:	17.6 KB 
ID:	331  

  4. #4
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default

    Certainly not. It should have been this :


    Thanks for reminding me that there indeed should be an example, to check if the system works correctly.

    About your attachment, I wondered how your browser-saving was done. Are you sure you saved the file still as a 8 BPP GIF?
    If somewhere inbetween the file has become 24 BPP again, it will not work. Which is the case when using JPG in the process.
    'Save as PNG' is possible, because it keeps the 8BPP status.
    I checked, and "chroma.jpg" doesn't contain equally colored blocks anymore.
    See the result if you import the same chroma.pal file once again, or use a color-dropper in a block..

    As a matter of fact (I just tested this) now both GIF files can be used for the same purpose.
    If "gray.pal" is imported in "chroma.gif", it should look like "palgrid_g8.gif" again.
    And so, if a 3rd palette is imported in both GIFs, the result should be the same.

    Edit: Now I noticed that your example has a size of 280x280. Resizing the original 320x320 makes it useless too.
    Last edited by Sam_Zen; 12.11.2007 at 03:29 AM.
    0.6180339887
    Rest In Peace, Sam!

  5. #5
    Moderator Laurent's Avatar
    Join Date
    May 2007
    Location
    Brussels, Belgium
    Posts
    882
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP3
    CPU Cores
    2

    Default

    Hi Sam_Zen,

    Thanks a lot for your reply. The example you posted is what I get now with the Gimp. But not with IrfanView. Maybe there is something wrong in what I did:
    - save your greyscale GIF image (from Mozilla/SeaMonkey 1.1.6)
    - open it with IV
    - Image / Palette / Import palette...
    - load chroma.pal

    Then the gif is displayed in IV exactly like the picture I posted. Colors are always strange, whatever the palette I load. For example, with earth.pal, there is no noticeable change (remains in the grays). With green.pal I get a range of... reds!

    When I just load palgrid_g8.gif IV says 320 x 320, 8 BPP and Image / Palette / Display displays a 256 grays palette, like the image.

    So I wonder what's going wrong. Maybe it's in the original GIF I use. Can you check it?

    Laurent
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	palgrid_g8.jpg 
Views:	456 
Size:	17.3 KB 
ID:	332  

  6. #6
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default

    Again, the attachment provided here, is of no use for a test, because it is a JPG of 280x280, not the GIF anymore.
    Maybe it has something to do with the attachment script of the forum.

    So I did your recipe too (Firefox) but all went well.
    To exclude any 'save as' modifications as possible cause, I made a zip-file to download "chroma.gif" here.

    The first one happened to be greyscale, but you'll see that chroma.gif should show a new imported palette as well.
    It's just about 256 colors, and no greyscale conversion should be in this process, it isn't relevant here.
    Greyscale is just a quick way to get the exceptional situation, that every pixel has equal values for RGB.

    .. save your greyscale GIF image (from Mozilla/SeaMonkey 1.1.6)
    .. When I just load palgrid_g8.gif
    This is not clear to me. Are these two different ways to download the gif file?
    Last edited by Sam_Zen; 18.02.2008 at 03:09 AM. Reason: other format
    0.6180339887
    Rest In Peace, Sam!

  7. #7
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default Checking the system

    ~ Save the basic GIF, open with IV, and export the palette file as basic.pal
    import another pal file
    whatever the outcome, import then basic.pal again. It should look like the basic GIF.

    ~ It could look exactly the same, but technically as data maybe it's not.
    Data comparison is needed here. The first lines (after the header) of the .pal file used for "palgrid_g8" are :

    0 0 0
    1 1 1
    2 2 2
    3 3 3
    4 4 4
    5 5 5
    6 6 6
    7 7 7
    8 8 8
    9 9 9
    10 10 10
    11 11 11

    The first lines (after the header) of the .pal file used for "chroma" are :

    48 48 48 'chromatic' color map
    56 48 56 by Todd Hedenstrom
    64 48 64
    72 48 72
    80 48 80
    88 48 88
    96 48 96
    104 48 104
    112 48 112
    120 48 120
    0.6180339887
    Rest In Peace, Sam!

  8. #8
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default Upgrade

    The PNG format seems to function as well with the examples, so I will use that for further pictures.
    Due to copyright complications I prefer to use the PNG format above the GIF one, if possible.
    The zip-file now contains the PNG version too.

    As seen with the chroma pal file, the original map files sometimes have extra comment text added.
    I didn't experience any trouble with it while reading the pal-file, but to avoid any risk I moved
    the textpart to an additional .txt-file if necessary.
    So to implement those changes one should re-download "pals0.zip" and "pals1.zip".

    The ultimate test came from a .pal file with all values the same (252), resulting into this one color PNG file :


    If then an imported palette looks correct with different blocks and all, the viewer functions alright.

    EDIT: I noticed the option in Misc3 : Miscellaneous/Import palette: use nearest color.
    This should be disabled for correct funtioning.
    Last edited by Sam_Zen; 14.11.2007 at 04:49 AM.
    0.6180339887
    Rest In Peace, Sam!

  9. #9
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default

    An example with color cycling of palettes can be found here
    0.6180339887
    Rest In Peace, Sam!

  10. #10
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,896
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default web-save palettes

    I found a page with : The Browser-Safe Web Palette by Lynda Weinman
    http://www.lynda.com/hex.asp

    Some aspects come in focus :
    The actual palette has a limit of 216. The other 40 are free, to serve differences between PC and MAC.

    And there are 2 different kinds : Based on Hue and based on Value. The two PAL-files derived from the examples :
    http://www.xs4all.nl/~samzen/downloa...als/webhue.pal
    http://www.xs4all.nl/~samzen/downloa...als/webval.pal

    In the same article other file formats for palettes appear to be there, seeing the CLUTS, whatever that may be.
    The zip contains data for several apps, Freehand, Painter, Photoshop, PhotoPaint, PaintShop Pro, and Windows.
    They all appear to have their own format(s) for describing a palette.
    SIT - BCF - ACO - CPL - CLUT
    Or no extension (Painter) with another header :
    ROWS 1
    COLS 16
    WIDTH 32
    HEIGHT 32
    TEXTHEIGHT 0
    SPACING 1
    R: 255, G:255, B:255
    R: 255, G:255, B:204
    etc
    Only PSP looks familiar for IV :
    http://www.xs4all.nl/~samzen/downloa...ls/browser.pal
    0.6180339887
    Rest In Peace, Sam!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •