JASC (*.pal) palette - not limited by 256 colors

Started by Muzzy, March 18, 2018, 12:48:00 PM

Previous topic - Next topic

Muzzy

It's possible to add option to save JASC (*.pal) palette files without limitation of color numbers? Right now I need to save palette in GIMP format and then correct it in Notepad manually, to make the text format match JASC (*.pal). For colors number around 1500 - it's fine, but i need to make a palette with 32768 colors - and this would be a problem.

Richard Moss

Hello,

Welcome to the forums and thanks for the question. Currently it isn't possible to disable the maximum colour limit on palettes. However, as JASC palettes are a text format I can provide you with a much easier workaround than manually editing files.

A previous major update to the editor introduced the ability to create templates and you could use this to generate your own JASC file, bypassing the restrictions when using the normal "Save As" functionality.

To do this,


  • From the File menu, choose Templates
  • Click the Add button
  • Enter a name for your template
  • Set the Default Extension to be pal
  • Enter the code below into the Content field.
  • The live preview on the right will automatically render using the currently open template - use this to see if the output is correct
  • Click the OK button to add the template and close the editor
  • Click the OK button to save the changes to templates

This is the code to use to generate a JASC format palette

JASC-PAL
0100
{{count}}
{%- for rgb in rgbcolors -%}
{{rgb.R}} {{rgb.G}} {{rgb.B}}
{%- endfor -%}


[attachment id=0 msg=598]

Now, to export the currently open palette using the template


  • From the File menu, choose Templates
  • Select your template from the list and click the Run button
  • When prompted, enter the export filename and click Save

The template will be ran against the current palette and save its output to the specified file.

Hope this helps!

Regards;
Richard Moss
Read "Before You Post" before posting (https://forums.cyotek.com/cyotek-webcopy/before-you-post/). Do not send me private messages. Do not expect instant replies.

All responses are hand crafted. No AI involved. Possibly no I either.

Muzzy

Thanks a lot! That's what I need. At first, the resulting palette file was opened in an external program that I use without the colors in it. But when I opened it in a Notebook, I realized that the file was in UTF-8 format, and when I saved it in ANSI, everything became as it should.

Richard Moss

#3
Thanks for letting me know it works.

From your description sounds like template output is including the UTF-8 BOM - that's a bug, I don't want to be writing those unless truly required, so I'll get that logged and fixed for a future update.

Regards;
Richard Moss

Edit: For reference, logged as #266 and should be in the next update to the software
Read "Before You Post" before posting (https://forums.cyotek.com/cyotek-webcopy/before-you-post/). Do not send me private messages. Do not expect instant replies.

All responses are hand crafted. No AI involved. Possibly no I either.