Reptillian Posted November 21, 2020 Posted November 21, 2020 (edited) Possible to do in codelab? What is my option? I plan to make a plugin with 224 palettes, and if a palette has 96 or less, it is set as palette, otherwise to image. Edited November 22, 2020 by Reptillian Quote G'MIC Filter Developer I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.
MJW Posted November 21, 2020 Posted November 21, 2020 I'm reasonably sure the palettes are read-only from plugins. The interface shown by Rick Brewster includes on "get" properties. Likewise, "What is and isn't possible when writhing plugins" mentions only read access. Quote
Reptillian Posted November 21, 2020 Author Posted November 21, 2020 6 hours ago, MJW said: I'm reasonably sure the palettes are read-only from plugins. The interface shown by Rick Brewster includes on "get" properties. Likewise, "What is and isn't possible when writhing plugins" mentions only read access. So, my option left is to export some how. Quote G'MIC Filter Developer I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.
MJW Posted November 21, 2020 Posted November 21, 2020 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. Quote
Reptillian Posted November 21, 2020 Author Posted November 21, 2020 (edited) 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 November 21, 2020 by Reptillian Quote G'MIC Filter Developer I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.
MJW Posted November 21, 2020 Posted November 21, 2020 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. Quote
Ego Eram Reputo Posted November 22, 2020 Posted November 22, 2020 @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. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker
Reptillian Posted November 22, 2020 Author Posted November 22, 2020 (edited) 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 November 22, 2020 by Reptillian Quote G'MIC Filter Developer I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.