Gimp-Forum.net
indexing into 8-bit - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: indexing into 8-bit (/Thread-indexing-into-8-bit)



indexing into 8-bit - griddx - 03-22-2019

When i try to index a 24-bit image with less than 16 colors (with the default indexing settings), gimp reduces the bit depth to 4-bit, but i need it to be 8-bit. Is there any way i can stop gimp from reducing the bit depth too much?


RE: indexing into 8-bit - rich2005 - 03-22-2019

Are you really using Windows 95? What version of Gimp? Those questions are not there just to annoy you Wink

Give more details of the image and Image format. Post an example if possible of the image from a WinXP machine.

A quick convert from RGB to Indexed with 12 colours and a default export to png works here.

[Image: 67wF43w.jpg]

Edit:

A bit more digging and it does look like 4 bit is correct.

Using Imagemagick it says 8 bit sRGB and then lists the (12) colour map. Further down in Properties it does say 4 bit. Converting the same to 256 colours and it reports 8 bit. 

Needs a bit more investigation.

Code:
Image: 1.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: PseudoClass
  Geometry: 603x521+0+0
  Resolution: 78.74x78.74
  Print size: 7.65812x6.61671
  Units: PixelsPerCentimeter
  Colorspace: sRGB
  Type: Palette
  Base type: Undefined
  Endianess: Undefined
  Depth: 8-bit
  Channel depth:
    Red: 8-bit
    Green: 8-bit
    Blue: 8-bit
  Channel statistics:
    Pixels: 314163
    Red:
      min: 4  (0.0156863)
      max: 254 (0.996078)
      mean: 145.09 (0.568982)
      standard deviation: 85.939 (0.337016)
      kurtosis: -1.4227
      skewness: 0.137116
      entropy: 0.669586
    Green:
      min: 4  (0.0156863)
      max: 254 (0.996078)
      mean: 202.116 (0.792611)
      standard deviation: 68.8272 (0.269911)
      kurtosis: 3.13315
      skewness: -2.00428
      entropy: 0.67326
    Blue:
      min: 3  (0.0117647)
      max: 253 (0.992157)
      mean: 210.822 (0.826752)
      standard deviation: 78.6523 (0.30844)
      kurtosis: 1.78678
      skewness: -1.84239
      entropy: 0.669586
  Image statistics:
    Overall:
      min: 3  (0.0117647)
      max: 254 (0.996078)
      mean: 186.009 (0.729448)
      standard deviation: 77.8062 (0.305122)
      kurtosis: -0.45414
      skewness: -0.994225
      entropy: 0.670811
  Colors: 12
  Histogram:
     26404: (  4,  4,  5) #040405 srgb(4,4,5)
      2231: ( 58, 74,158) #3A4A9E srgb(58,74,158)
        28: ( 69, 35, 10) #45230A srgb(69,35,10)
    126054: ( 82,213,253) #52D5FD srgb(82,213,253)
     27339: (129,151,235) #8197EB srgb(129,151,235)
       737: (157,234,238) #9DEAEE srgb(157,234,238)
      3347: (174,213, 91) #AED55B srgb(174,213,91)
     19976: (175,215, 79) #AFD74F srgb(175,215,79)
       232: (243, 55, 52) #F33734 srgb(243,55,52)
      1420: (251, 44,  3) #FB2C03 srgb(251,44,3)
     74552: (252,254,250) #FCFEFA srgb(252,254,250)
     31843: (254,253,211) #FEFDD3 srgb(254,253,211)
  Colormap entries: 12
  Colormap:
         0: (  4,  4,  5,255) #040405FF srgba(4,4,5,1)
         1: ( 69, 35, 10,255) #45230AFF srgba(69,35,10,1)
         2: ( 58, 74,158,255) #3A4A9EFF srgba(58,74,158,1)
         3: (251, 44,  3,255) #FB2C03FF srgba(251,44,3,1)
         4: (243, 55, 52,255) #F33734FF srgba(243,55,52,1)
         5: (129,151,235,255) #8197EBFF srgba(129,151,235,1)
         6: ( 82,213,253,255) #52D5FDFF srgba(82,213,253,1)
         7: (174,213, 91,255) #AED55BFF srgba(174,213,91,1)
         8: (175,215, 79,255) #AFD74FFF srgba(175,215,79,1)
         9: (157,234,238,255) #9DEAEEFF srgba(157,234,238,1)
        10: (254,253,211,255) #FEFDD3FF srgba(254,253,211,1)
        11: (252,254,250,255) #FCFEFAFF srgba(252,254,250,1)
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 603x521+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2019-03-22T19:30:35+00:00
    date:modify: 2019-03-22T16:38:04+00:00
    png:IHDR.bit-depth-orig: 4
    png:IHDR.bit_depth: 4
    png:IHDR.color-type-orig: 3
    png:IHDR.color_type: 3 (Indexed)
    png:IHDR.interlace_method: 0 (Not interlaced)
    png:IHDR.width,height: 603, 521
    png:pHYs: x_res=7874, y_res=7874, units=1
    png:PLTE.number_colors: 12
    png:sRGB: intent=0 (Perceptual Intent)
    png:tIME: 2019-03-22T16:38:04Z
    signature: a47800b0f27b9cabcf1459e4d3ce1c638f75705e8cb4f9520b42ce640758b654
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 11200B
  Number pixels: 314163
  Pixels per second: 31.4163MP
  User time: 0.010u
  Elapsed time: 0:01.010
  Version: ImageMagick 7.0.8-24 Q16 x86_64 2019-01-24 https://imagemagick.org
edit2: No luck at all. Even using IM to covert to a 12 colour indexed image I get the same results as above.  Looks like it is built in as far as Indexed images are concerned. 
see: http://www.imagemagick.org/Usage/formats/#png Sub-Formats for the png types. Other formats, I do not know.


RE: indexing into 8-bit - Ofnuts - 03-22-2019

You can color-index, and then artificially grow the color map to contain more than 16 entries (Windows>Dockable dialog>Color map, and hit the + button until you have more than 16 colors. The extra colors won't be used by the indexing but will force a 8-bit colormap to be used.


RE: indexing into 8-bit - rich2005 - 03-23-2019

I went similar way as well but 17 colours then edited the colours to duplicated colours reducing the number of actual colours to (example) 12. Ofnuts method is better.

[Image: WeuIoFy.jpg]

I am still wondering why the requirement for 8 bit and also the actual file format. gif / png / tiff. ?


RE: indexing into 8-bit - griddx - 03-25-2019

Thanks for the replies. Ofnuts' method worked for me.