Post Reply 

Creating a Palette with 512 colours?

Feb 17, 2014, 16:34
Post: #1
Creating a Palette with 512 colours?
Hi there,

I am very new to this so please bear with me if I make any mistakes. I've been doing some drawings that I did by hand and scanned them so I could use them for pixel art. It would save me time and alot of money.

However I have a problem. My pixel art is 9-Bit and so it would be great to convert the hand-drawn art into 9-Bit which is 512 colours. I know the best way to do it is to use the palettes via the Image->Mode. There's a problem though. I have no idea how to make a palette with 512 colours. Even how to do it the long way round.

Can anyone help me out?
Find all posts by this user
Quote this message in a reply
Feb 17, 2014, 19:04 (This post was last modified: Feb 18, 2014 09:38 by rich2005.)
Post: #2
RE: Creating a Palette with 512 colours?
A gimp palette is just text file with a list of RGB values.

This is the standard Gimp 'Named_colours.gpl' which contains 442 colours. You could tack another 10 on the end.

Code:
GIMP Palette
Name: give_it_a_new_name
Columns: 16
#
255 250 250    snow (255 250 250)
248 248 255    ghost white (248 248 255)
245 245 245    white smoke (45 245 245)
......cut out lots of entries.........
......cut out lots of entries.........
2139   0   0    dark red (139   0   0)
144 238 144    light green (144 238 144)
....that is 442 colours - add another 10....

Never tried this script but it generates a palette from part of an image.
http://registry.gimp.org/node/28695 might be worth a try.

edit: seem to recall, there is a function in the g'mic plug-in that generates a palette from the colours crossed by a path.
edit again: memory was playing tricks - the gmic function is to generate a gradient.

Don't understand your Image -> mode conversion. I would think colour menu -> Map -> palette map would be the one to use.

and

Reducing the number of colours is not the same as reducing the color depth of the image. For a 9 bit image ImageMagick might be a better bet than Gimp.

edit, Reducing the number of colours in IM is trivial
convert in-image.ext -colors 512 out-image.ext
reducing the bit depth should be equally easy but I don't know about 9-bit. The syntax is
convert in-image.ext -depth (no of bits) out-image.ext
but while 8 works fine, 9 gets reported as 16 bit. Need to dig a bit.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Feb 19, 2014, 23:36
Post: #3
RE: Creating a Palette with 512 colours?
I used the script and it made a Personal Palette perfectly! However I can't use the palette though. It doesn't appear in the List/Grid View. It only appears in the Edit Palettes section. What do I do?
Find all posts by this user
Quote this message in a reply
Feb 20, 2014, 11:26 (This post was last modified: Feb 21, 2014 10:07 by rich2005.)
Post: #4
RE: Creating a Palette with 512 colours?
(Feb 19, 2014 23:36)King_Tetiro Wrote:  I used the script and it made a Personal Palette perfectly! However I can't use the palette though. It doesn't appear in the List/Grid View. It only appears in the Edit Palettes section. What do I do?

Ok, grabbed that script, and seems to save the file, the default is to pop the new palette into your 'profile' .gimp-2.8\palette. That works here, so check in that folder. It might be the name you entered is causing a problem.

The script divides the image into squares, so for 512 colours the obvious ratio is 16 wide x 32 deep which means that your image probably has to be scaled to width by 2x width. Smaller than that and less than 512 colours are made. I did try 32 columns wide x 16 rows. This crashed my gimp which never-ever happens but it did make the palette.

Here is a demo video which might give a clue why the generated palette does not appear for you.

edit: having a tidy up - everyone finished with this ...going..going..gone
http://www.youtube.com/watch?v=KNG3HAN3Y8E&hd=1 5 minutes

Two parts, the script in action and maybe an alternative way, reducing the number of colours to 512 first then generating a palette.

Selecting a colour:
If the palettes editor is open, just use it.
More usually, click on the fg/bg icon that brings up the color selector, one of the options is palette.

[Image: 0L37GMS.jpg]

9 bit images, That is intriguing. Closest I can come up with is 8 bit 3( R ) + 3( G ) + 2( B ) which is 256 colors.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Feb 20, 2014, 17:04
Post: #5
RE: Creating a Palette with 512 colours?
I'm trying to use my Personal Palette via the Image->Mode->Indexed Colours. Can anyone help me out?
Find all posts by this user
Quote this message in a reply
Feb 20, 2014, 17:52
Post: #6
RE: Creating a Palette with 512 colours?
I had a feeling about 512 colours......Wink

You are confusing a palette with a colormap.
A RGB image has red, green, blue values assigned to each pixel.
This is the reduced to 512 colours image with the red channel disabled. So it shows up as a combination of green and blue.
screenshot http://i.imgur.com/bWK6vFV.jpg

In indexed mode, the image has a colormap ( a chart of colours) This is limited in Gimp (and most other editors) to 256 colours, so your 512 palette is out the window.
Works on the principle pixel number one might be color number 96, pixel number 2 color 201 -- and so on throughout the image.
When you change mode from rgb to indexed a colormap of 256 colours is generated.
screenshot http://i.imgur.com/TnQtPRw.jpg

It is possible to asign a custom palette when changing modes. This has to be 256 colours or less, which is why you can not see it. You have been making 512 colour palettes.
Looks like this. http://i.imgur.com/wAQd1zh.jpg

Use the script to generate a 256 colour palette. Size the image to height = width (square) for this 16 colums x 16 rows. Use that palette when changing mode. Compare the second image with this next one. The colormaps are very different. Up to you to decide which is best. Changing colormaps can lead to very strange results.
screenshot http://i.imgur.com/NcfTHv5.jpg

BTW - converting to indexed mode does not make a 9 bit image, it is 8 bit ie. 256 colours.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Exchanging Colours pipp44 1 130 Aug 3, 2018 11:23
Last Post: paynekj
  Derive duotone "colours" from an existing photo jrickards 1 270 Mar 7, 2018 22:10
Last Post: paynekj
  Creating BMP images from a layer jgarnold 1 344 Dec 16, 2017 06:38
Last Post: ythgilb
Question Saving to a gif format and choosing the color palette SpongeBob 0 320 Dec 13, 2017 19:13
Last Post: SpongeBob
  Matching colours callum_suttle 1 602 Jun 5, 2017 18:48
Last Post: blighty

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS