nate-xyz / paleta

Extract the dominant colors from any image.
https://beta.flathub.org/apps/io.github.nate_xyz.Paleta
GNU General Public License v3.0
96 stars 14 forks source link

Export palette to a GPL palette file #8

Open tfuxu opened 1 year ago

tfuxu commented 1 year ago

GPL is an simple palette definition format created by GIMP that allows for a quick import of a palette set to most open-source graphic tools. Export option to this format would be a useful feature for most artists using open-source graphics editors, like GIMP, Krita, Inkscape, Aseprite... and the list goes on.

I couldn't find any Python library for parsing this format, but I found an good explanation of it on Dezmerean's blog, and it seems like a simple parser for GPL could be created in less than an evening.

Probably for now it would be sufficient to just put an button in Palettes tab with an icon like this (for more GTK icons I recommend downloading Icon Library if you haven't already) in every palette row or next to Edit Palettes button, and show user an file chooser dialog where he could choose an destination path for palette file.

As for possible future export window design, I would recommend checking out Paletton and clicking an Tables / Export button in the down right corner. Also adding export options to formats like ACO (Photoshop palette file), Sketch palette and PNG file would be definitely an great addition.

Closing words, I like this app. It feels like an professional graphics utility and it is a great addition to the GNOME ecosystem. You'll probably would want to fix some rough edges and add translation support, before submitting Paleta to GNOME Circle, but after that, I think you'll be warmly accepted to the GNOME Circle.

nate-xyz commented 1 year ago

Great idea, I'll definitely work on this. Glad you like the app!

beatjaeckle commented 1 year ago

I would like to have an option not only to export, but also import the palettes.

Closing words, a nice project. I'm looking forward to use it.

tfuxu commented 1 year ago

I found a GPL parser for Rust: https://docs.rs/gimp_palette/latest/gimp_palette/

Also, Eyedropper added support for exporting colors as ASE file in this commit: https://github.com/FineFindus/eyedropper/commit/f1c4f1aab42f4a7f1dbaf16f1c2b0d855ca86833 From what I know, ASE is simillar to ACO format and can be imported to Photoshop and also Illustrator.

There is also a converter from GPL to ACO written in Python: https://gist.github.com/mieki256/b230c5dc678ed3363f15b7ed7a38c935 This isn't a full parser, but it can be useful in reverse-enginerring the ACO format.