Jump to content

Sending set of colors to palette? [SOLVED]


Reptillian

Recommended Posts

4 hours ago, Reptillian said:

So, my option left is to export some how.

I'd assume the somehow would be to save as a Palette file, which are simple .txt files in the Palettes folder.

 

Quote

; paint.net Palette File
; Lines that start with a semicolon are comments
; Colors are written as 8-digit hexadecimal numbers: aarrggbb
; For example, this would specify green: FF00FF00
; The alpha ('aa') value specifies how transparent a color is. FF is fully opaque, 00 is fully transparent.
; A palette must consist of ninety six (96) colors. If there are less than this, the remaining color
; slots will be set to white (FFFFFFFF). If there are more, then the remaining colors will be ignored.

 

 

Link to comment
Share on other sites

So, it would seem that my option is to write a script that converts my palettes into a set of vector, then convert them to palette file via c++ for all palettes that have 96 colors or less. And this hypothetical plugin would only be useful for all palettes with more than 96 colors.

 

EDIT: It seems that I have 13 palettes with 97+ colors. Not sure if that sounds useful.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

2 hours ago, Reptillian said:

So, it would seem that my option is to write a script that converts my palettes into a set of vector, then convert them to palette file via c++ for all palettes that have 96 colors or less. And this hypothetical plugin would only be useful for all palettes with more than 96 colors.

 

I don't know what format your palettes are in, but I would suppose they're files in which the colors are stored, likely as three (RGB) or four (ARGB) color components per entry. If so,  I don't see the reason for the steps mentioned. A singe C# (or C++, if you must) program could input one of your palette files and output a PDN palette file. You don't actually need to limit it to palettes of 96 colors or less, since PDN simply ignores the excess entries.

Link to comment
Share on other sites

@Reptillian It is feasable to display all the palettes as an image and allow the user to select a block of 96 to export as a PDN palette?

 

224 x 96 = 21504 shades. If each shade were 5x5 pixels the image would be around 735px square. A palette block would be 30 x 80 pixels. Roughly half the size of the full palette in the Colors Window.

Link to comment
Share on other sites

5 hours ago, Ego Eram Reputo said:

@Reptillian It is feasable to display all the palettes as an image and allow the user to select a block of 96 to export as a PDN palette?

 

224 x 96 = 21504 shades. If each shade were 5x5 pixels the image would be around 735px square. A palette block would be 30 x 80 pixels. Roughly half the size of the full palette in the Colors Window.

 

@MJW I had converted the palettes into non-standard syntax i.e not seen in any existing palette file format in use for gmic filters, and there are over 220 palettes. Hence why I had decided to resort to using C++, and I found that it works. It took some work, but did it anyway.

 

Technically, that should be feasible. However, I don't think it's worth it because my palette collection has only 13 palettes that contains over 96 colors. I think I'm better off just creating a collection of 96- colors PDN.txt palettes through C++.

 

EDIT: I just had uploaded a collection of 211 palettes. Consider this thread solved.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

  • Reptillian changed the title to Sending set of colors to palette? [SOLVED]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...