Post Reply 

Color Depth Conversion

Mar 4, 2012, 23:13 (This post was last modified: Mar 4, 2012 23:39 by Vheos777.)
Post: #1
Color Depth Conversion
Hey,

I've created a palette consisting of 343 color. What I want to achieve is to convert an image so it only uses colors from the palette. Think of it as an indexed image, but with color amount exceeding 256.

So basically, whenever the converting tool scans a pixel, it should find the most similar color from the palette and use it instead. I want it to round each RGB value to one of these (in my case):
0, 43, 85, 128, 170, 213, 255
For example, R17 G90 B155 would get converted into R0 G85 B170.

Here's how I'd imagined the conversion process:
Original image (256 colors) - http://img705.imageshack.us/img705/9523/earth256.png
Converted iamge (125 colors) - http://img594.imageshack.us/img594/1660/earth125.png
It's basically converting higher color depth into a lower one. If only the indexed images could contain palette bigger than 256 colors...

I've tried using the "Colors -> Map -> Palette Map" tool, but it's based on luminosity and the actual colors' location on the palette, which results in pseudorandom colorization of the image.



Any help will be greatly appreciated.

PS. I'm attaching a bitmap of the 343 colors you can extract the palette out of.


Attached File(s)
.bmp  343 Colors.bmp (Size: 516.85 KB / Downloads: 55)
Find all posts by this user
Quote this message in a reply
Mar 5, 2012, 00:52
Post: #2
RE: Color Depth Conversion
A possible solution is to make two version of your image, one where everything with value above 50% gray is converted to white and one where everything under with value under 50% gray is converted to black. Then you quantize these two images using two palettes with 5^3=125 colors, and then merge the results.

But if you want to be that accurate, how do you know if Gimp is going to use the real values you want (btw, the middle value of the 0-255 range is 127). So you'll want to look at ImageMagick: http://www.imagemagick.org/Usage/quantize/

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Desaturate to color KWiK 2 108 Oct 9, 2017 22:14
Last Post: KWiK
  Removing color from multiple images Aquilo 6 2,922 Sep 28, 2017 12:56
Last Post: angel0sdh
  Image color vs color picker YalithKBK 1 214 Jul 7, 2017 11:45
Last Post: ythgilb
  Change transparent background color Firion 1 248 Jun 14, 2017 05:24
Last Post: ythgilb
  Blur tool changes the color F_Jenkins17 3 289 Oct 8, 2014 07:38
Last Post: ofnuts

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS