Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Would someone be willing to make this plug-in for me? 15-bit color
#1
Hello; I have not been to this forum before, so I don't know what the proper etiquette is for this sort of thing.  If asking for favors like this is a big no-no, then I apologize and won't ask why I don't have any responses.

I am looking for some functionality to help with my pixel art, but I am not familiar with the scripting and programming that GIMP uses.
I'd like a tool or command or something to help me convert my colors to 15-bit.  (Of course, the image itself would not be saved in this format, I just need to convert the colors I am using/making.)

Just so we're all on the same page of what I mean by 15-bit color, it is this:  Instead of the RGB channels having a range of 256 colors, they have a range of 32.
I don't need to redesign the fundamental way GIMP handles color data, I just need to conform the colors I am using to match those limitations.  Since GIMP operates in 24-bit color, this just means that the RGB value of any color needs to be a multiple of 8.

A color value of (104, 120, 160) is a 15-bit color, but a color value of (106, 120, 160) is not.
So what I want is a tool that would convert the color (106, 120, 160) into (104, 120, 160).

As for exactly how this tool should operate, I'm fairly open to a lot of implementations.  I don't know the inner working of GIMP, so I don't know what methods would be the easiest to create.  (And I am asking for this as a favor, after all.)

I could accept a tool that would convert a whole image (or whole layer) into 15-bit color.  Perhaps a script that separates the channels, converts each of those channels to a 32 color palette set to the correct multiple-of-eight values, (convert to an index of 32 values won't work right,) and then recombines them into a single image again.
I could accept a tool that goes through the colormap and converts each index to a a 15-bit color.  I don't commonly work within the indexed mode, but it is no hassle to convert to it just to get the colors correct.
I could accept a new layer mode that converts the colors to be 15-bit even though it would only change how it is displayed.  Actually that would be really useful for quickly making tests and iterations.  (Honestly the layer modes could stand to get some overhauls anyway; I've seen a number of pixel artists use photoshop because there they can set up layers to convert their art to custom stepped gradients, allowing them to use painting tools but still convert their images into a proper palette.)
I could even take a tool that just converts my currently selected foreground/background colors into 15-bit, if that's a thing.  It may take a little bit of time for me to go through all of the colors I am using, but it is still worlds faster than manually tweaking each color by checking its values one at a time.

Or if there is some other method that would make more sense to whoever would be doing me the favor of creating this tool, I probably could accept that too.  I just want to be able to convert the colors I am using into 15-bit.
Reply
#2
Brick 
Not a script but i wonder if exporting as a bmp would suffice.

[Image: XEr0unz.jpg]

5 bits per channel (+ alpha bit)

Make an image with the colours you use, export, re-open, create palette from image.
Reply
#3
(10-26-2017, 07:22 PM)rich2005 Wrote: Not a script but i wonder if exporting as a bmp would suffice.

5 bits per channel (+ alpha bit)

Make an image with the colours you use, export, re-open, create palette from image.

Palettes seem to be limited to 10K colors (15-bit would be 32K). Not very manageable anyway. But yes for the auto-conversion.
Reply
#4
(10-26-2017, 05:17 PM)Marscaleb Wrote: I could even take a tool that just converts my currently selected foreground/background colors into 15-bit, if that's a thing.  It may take a little bit of time for me to go through all of the colors I am using, but it is still worlds faster than manually tweaking each color by checking its values one at a time.

That one would be easy. It would just be a script that rounds the current fg/bg colors to the nearest 5-bit equivalent (actually drops the 3 LSB's).
It could be assigned to a keyboards shortcut, and you would have to get used to strike that key after changing colors. But nothing would prevents Gimp from generating 24-bit colors (in a gradient, for instance).
Reply
#5
(10-26-2017, 08:55 PM)Ofnuts Wrote:
(10-26-2017, 07:22 PM)rich2005 Wrote: Not a script but i wonder if exporting as a bmp would suffice.

5 bits per channel (+ alpha bit)

Make an image with the colours you use, export, re-open, create palette from image.

Palettes seem to be limited to 10K colors (15-bit would be 32K). Not very manageable anyway. But yes for the auto-conversion.

I was not thinking of anything like full  HiColor-32K number of colours.

How many colours does a pixel artist use? I do not know but probably favourites & not that many.

Most of the stock palettes are around the 256 mark and less, The largest I have and very occasionally use is the pantone palette with around 1000 colours.

Out of interest, converted that to 15 bit and sorted. Wonderful format .gpl, opens up in a spreadsheet Wink FWIW attached.

Quote:That one would be easy. It would just be a script that rounds the current fg/bg colors to the nearest 5-bit equivalent (actually drops the 3 LSB's).

There you go, get stuck in. 
Seriously, it surprising that there is not a plugin to reduce the number of colours in this way. There is posterize but not applicable. Not much in the way of other applications either. I thought ImageJ might do it, but no. Vague memory that PSPro might (or might not). Is PS the only one?


Attached Files
.zip   1097.gpl.zip (Size: 3.79 KB / Downloads: 245)
Reply
#6
(10-26-2017, 07:22 PM)rich2005 Wrote: Not a script but i wonder if exporting as a bmp would suffice.

[Image: XEr0unz.jpg]

5 bits per channel (+ alpha bit)

Make an image with the colours you use, export, re-open, create palette from image.

Wow, I...  I had no idea it was there all along...

So, what exactly is the "X1" compared to the "A1"?  I would assume that A1 is using a one-bit alpha channel, which would be the format I would use most for my sprites.  but what is "x1"?  What is that extra bit being used for?
Reply
#7
(10-27-2017, 04:11 PM)Marscaleb Wrote: So, what exactly is the "X1" compared to the "A1"?  I would assume that A1 is using a one-bit alpha channel, which would be the format I would use most for my sprites.  but what is "x1"?  What is that extra bit being used for

I honestly do not know. There is little info on the Gimp export bmp format around.

As a guess.
Exporting an image with an alpha channel the both a1 and x1 options are enabled
Exporting an image without an alpha channel, then only the x1 option is enabled.
Best guess, for an image with alpha channel, x1 disables the alpha bit.

As a note:
If you are feeding these into another application check the compatibility option. I use bmp format with a linux command line application Autotrace, which needs that turned off. Weird, but there you areWink.
Reply


Forum Jump: