Grid Sage Forums

Grid Sage Forums

  • December 03, 2024, 09:45:13 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: .gpl File type Support.  (Read 11249 times)

BenDragon81037

  • Unaware
  • *
  • Posts: 9
    • View Profile
.gpl File type Support.
« on: December 08, 2023, 06:03:25 AM »

.GPL is a palette file used by GIMP which lets you specify an unlimited amount of colours.
these .gpl files are also supported by inkscape and krita.

The file format is human readable so you can open the file up in a text editor and make your own if you know the RGB values.

Attached are sample files I compiled from e-paint.co.uk using regular expression to show you an example of what they look like.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4480
    • View Profile
    • Cogmind
Re: .gpl File type Support.
« Reply #1 on: December 08, 2023, 06:16:38 AM »

The file format is human readable so you can open the file up in a text editor and make your own if you know the RGB values.
Note that Cogmind's palette files are also human readable and you can do the same thing if you know the RGB values. That's how users generated all those palettes on the resources page.

There's tons more information about this and many other features in the manual included with the download.

Unlimited colors is not something REXPaint will do, though. In the current version they must fit on the grid presented. A future 2.0 would be significant expanded in many ways, especially the UI, so who knows then. I was eager to expand the tileset size to unlimited height, since that was a highly request feature over the years, so that was done, but I've never heard of anyone wanting more than the 192 colors that REXPaint supports. The vast majority of people are working with palettes significantly smaller than that. Of course if it's really important one can also have a couple palette files since it's easy to swap between them.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

BenDragon81037

  • Unaware
  • *
  • Posts: 9
    • View Profile
Re: .gpl File type Support.
« Reply #2 on: December 08, 2023, 05:50:43 PM »

Oh you're totally right and I completely understand that.  :D

I also agree with you, the reason why I suggest this, is to make it simpler to transfer palette files between applications more seamless.

If you are not too enthusiastic about the unlimited nature of it? Why not read the file and when the palette in REXPaint fills up, it could simply continue attempting to write something into nothing?

The idea really is just a wild take based on scam USB Flash storage devices. 🤷🏻‍♂️

Maybe truncate the read attempt when the palette is full to save on loading time, especially when you have literally millions of colours? idk, it's your program and you don't need to take on board my suggestions. Nor should you feel pressured into implementing my suggestion.

It's already an awesome program and I can't wait for 2.0!
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4480
    • View Profile
    • Cogmind
Re: .gpl File type Support.
« Reply #3 on: December 08, 2023, 07:33:26 PM »

Oh sure it's doable, and that's a potential reason to do it, cross-compatibility, it's just not compatible with the way RP handles palettes and would require significant changes. It would make more sense to simply have a separate converter for turning Gimp palettes into the format used by RP, operating on the text file itself. Someone could do this pretty easily.

Or a simpler approach would just be if you drop a .gpl into the normal palettes directory, REXPaint can just detect and automatically convert the first 192 colors for you and delete the original. Basically a built-in importing feature. That would be quite easy, too.

2.0 is going to be a who-knows-how-long kind of wait xD
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

BenDragon81037

  • Unaware
  • *
  • Posts: 9
    • View Profile
Re: .gpl File type Support.
« Reply #4 on: December 10, 2023, 07:44:17 AM »

I am not too sure really?
Considering GPL uses
Code: [Select]
  R   G   B NameAnd yours uses
Code: [Select]
{  R   G   B}ignoring the header, A regular expression code handles the conversion partially okay?
Find
Code: [Select]
(\d+\s+\d+\s+\d+).+Replace
Code: [Select]
{$1}
I guess without more experimenting with how palettes are handled within RP it's really hard to say.

I am pretty sure that it's possible to automate the conversion between the palette styles with an independently run script file? I am not too sure on this sort of stuff myself. :P
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4480
    • View Profile
    • Cogmind
Re: .gpl File type Support.
« Reply #5 on: December 10, 2023, 09:10:12 PM »

No need to experiment with how they're handled within RP, since it's not relevant for a situation like this--you can see the formatting in both cases right in the files. Anyway, it's on the list for potential automation at a later point.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

BenDragon81037

  • Unaware
  • *
  • Posts: 9
    • View Profile
Re: .gpl File type Support.
« Reply #6 on: December 11, 2023, 07:17:22 PM »

Oh I didn't mean it like that...

The RGB values are handled differently between .GPL and .txt so experimenting with a temporary solution as a stop gap measure while you develop 2.0 may be an interesting idea.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4480
    • View Profile
    • Cogmind
Re: .gpl File type Support.
« Reply #7 on: December 11, 2023, 09:42:29 PM »

The RGB values represent the exact same thing though? They're just three numbers that each range from 0~255. If you mean formatting... yes, that's exactly what I've been saying:
Quote
have a separate converter for turning Gimp palettes into the format used by RP, operating on the text file itself. Someone could do this pretty easily.

It's just a question of formatting, easily solved via an external solution to convert between the two. I'm not sure why you indicate "I am not too sure really?"... it really is that simple!

If you were responding to this (I can't tell because you didn't quote any specific part)
Quote
Or a simpler approach would just be if you drop a .gpl into the normal palettes directory, REXPaint can just detect and automatically convert the first 192 colors for you and delete the original. Basically a built-in importing feature. That would be quite easy, too.
then yeah that's not something you can do because I didn't implement it; as emphasized there I was suggesting potential automated solutions that "can" come in the future at some point! Something RP "would be" capable of without too much trouble, and probably satisfy most use cases.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

BenDragon81037

  • Unaware
  • *
  • Posts: 9
    • View Profile
Re: .gpl File type Support.
« Reply #8 on: December 14, 2023, 06:32:48 PM »

Quote
It's just a question of formatting, easily solved via an external solution to convert between the two. I'm not sure why you indicate "I am not too sure really?"... it really is that simple!
Yeah... 😅

Scripting is something that I really struggle with... Especially when I don't really understand many programming languages.

It's kind of why this thread exists... 😓 I am sorry.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4480
    • View Profile
    • Cogmind
Re: .gpl File type Support.
« Reply #9 on: January 09, 2024, 09:06:35 PM »

Automated .gpl/GIMP palette importing is now included as part of REXPaint 1.7!

Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

BenDragon81037

  • Unaware
  • *
  • Posts: 9
    • View Profile
Re: .gpl File type Support.
« Reply #10 on: January 23, 2024, 01:51:16 PM »

Nice! Thank you! 🙏
Logged

Sludge

  • Unaware
  • *
  • Posts: 4
    • View Profile
Re: .gpl File type Support.
« Reply #11 on: February 10, 2024, 03:08:10 PM »

Nice touch!  I had a need to get palettes from Photopea into RexPaint.  Photopea exports Adobe's ACO format.  I wrote this program to convert from ACO to GPL.

https://github.com/frogtoss/palettetool
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4480
    • View Profile
    • Cogmind
Re: .gpl File type Support.
« Reply #12 on: February 10, 2024, 04:39:13 PM »

Oh cool, thanks for the indirect feature support in that case :)
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon