totjoss Posted October 10, 2020 Share Posted October 10, 2020 Hey there everyone, I'm generating color sets so I don't have to add colors in a new palette manually. However I just figured out that a Affinity color palette (.afpalette) is a binary file. Would there be a way to import/convert a palette from any kind of text file (xml, json, etc.) that can be generated ? In comparison Krita does save palette in a custom archive containing text files. Thanks in advance for your help. Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted October 10, 2020 Share Posted October 10, 2020 Affinity applications can also import .ase files via the Import Palette dialog, and they are (I think) in a plain-text format. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
lacerto Posted October 10, 2020 Share Posted October 10, 2020 (...) Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted October 10, 2020 Share Posted October 10, 2020 35 minutes ago, Lagarto said: They are binary Thanks. I misinterpreted something I found via an Internet search. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
totjoss Posted October 10, 2020 Author Share Posted October 10, 2020 2 hours ago, Lagarto said: They are binary but there are tools on the Internet that can convert them to e.g. XML and then back to ASE, to be imported in Affinity. EDIT: I cannot check this now, but it seems that there is no way to get XML back to ASE. But see C:\Program Files\Affinity\Publisher\Resources\Pantone (or equivalent on macOS) to examine the .CSV palettes, which is the way Affinity apps read "PANTONE" swatches. I think that you could use this feature to read in any RGB or/and CMYK based named color values saved in a text file as a palette in Affinity apps. The Pantone trick seems to be the solution, thanks a lot ! lacerto 1 Quote Link to comment Share on other sites More sharing options...
lacerto Posted October 11, 2020 Share Posted October 11, 2020 (...) Quote Link to comment Share on other sites More sharing options...
totjoss Posted October 15, 2020 Author Share Posted October 15, 2020 On 10/11/2020 at 6:32 AM, Lagarto said: I found a PHP script that can create ASE binary files from text input: http://www.colourlovers.com/web/blog/2007/11/08/color-palettes-in-adobe-swatch-exchange-ase I tested this and the .ase file this script creates can be imported to Affinity apps without problems so this would be an alternative to using the .CSV files. I tried it as well as it looks promising, however both Photoshop and Affinity say the file is invalid. How did you make it work ? In the script, function making the ASE content just returns it but doesn't output it to a file, so I've just added a echo before output it to a file : "php ase.php > test.ase". Quote Link to comment Share on other sites More sharing options...
lacerto Posted October 15, 2020 Share Posted October 15, 2020 (...) SureWeb 1 Quote Link to comment Share on other sites More sharing options...
h_d Posted October 15, 2020 Share Posted October 15, 2020 To run the .php script in MacOS: Download the .zip file from @Lagarto's post above. To your Downloads folder. It should unzip automatically, giving you a file called createasepalette.php. Launch Terminal. Type cd Downloads and press Return. Type php createasepalette.php and press Return. The .ase file (test.ase) will be written to your Downloads folder. Quit Terminal. In Affinity Photo (or any Affinity app), click the Hamburger icon in the Swatches Palette and chose one of the options from Import (Document, Application or System). Navigate to your Downloads folder and choose test.ase. Result: Cheers, H lacerto 1 Quote Affinity Photo 2.5.3, Affinity Designer 2.5.3, Affinity Publisher 2.5.3, Mac OSX 14.5, 2018 MacBook Pro 15" Intel. Link to comment Share on other sites More sharing options...
lacerto Posted October 16, 2020 Share Posted October 16, 2020 (...) Quote Link to comment Share on other sites More sharing options...
lacerto Posted October 18, 2020 Share Posted October 18, 2020 (...) Quote Link to comment Share on other sites More sharing options...
totjoss Posted October 18, 2020 Author Share Posted October 18, 2020 7 hours ago, Lagarto said: I created a simple Windows command line utility that can convert RGB and CMYK color definitions along with swatch names saved in a UTF-8 text file to an ASE binary file that can be imported into Affinity apps. I have tested this very little so if you interested, please use at your own risk. The utility is created primarily for the purpose of creating ASE palettes to be imported in Affinity apps so there is no currently support for grouping of the swatches, nor LAB and Grayscale color definitions, nor is there support for specifying whether a swatch is global, local or spot (all swatches will import as local in Affinity apps). The notation of colors could easily be enhanced to support direct import of certain specific formats of text-coded palettes. The page at http://www.selapa.net/swatches/colors/fileformats.php#adobe_ase lists some but I do not know if any of the ones documented here would be practical as a universal text-based palette format to be used in these kinds of conversions. text2ase.zip 72.62 kB · 1 download This is really great Lagarto, thanks for the help ! However I have this error message when I try to execute your utility: The application to execute does not exist: 'C:\Users\[...]\text2ase\text2ase.dll'. Did you forget to put the library file ? Also when I first attempt to use it, Windows Defender recommended me to analyse it - maybe it blocked it somehow. Quote Link to comment Share on other sites More sharing options...
lacerto Posted October 18, 2020 Share Posted October 18, 2020 (...) totjoss 1 Quote Link to comment Share on other sites More sharing options...
totjoss Posted October 18, 2020 Author Share Posted October 18, 2020 26 minutes ago, Lagarto said: Yep, and the runtime configuration file, as well! Please try again with this one: text2ase.zip 83.16 kB · 0 downloads You might also need the .NET Core 3.1 runtime: https://dotnet.microsoft.com/download/dotnet-core/3.1 It works greatly. Thanks a lot ! lacerto 1 Quote Link to comment Share on other sites More sharing options...
lacerto Posted October 18, 2020 Share Posted October 18, 2020 (...) Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.