Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change Amount Channels In Pic
#12
(01-19-2021, 01:10 PM)Winston Wrote: There seems to be a miscommunication.

I'm trying to program a picture file to have 2-channel color, not have one with 3-color only have 2 colors.

For instance, it could be colored #YYBB, #RRCC, or #MMGG, instead of #RRGGBB.

We hear this. But there is no image format that supports this, at least none that is natively supported in GIMP. So out of the box you have to work with a 3-channel format where one channel remains unused. This isn't as wasteful as it looks since the compression algorithms can be expected to take this uniformity in account. Or you know how to program and write your own file load/save plugin (all file formats in Gimp except XCF are implemented as plugins...)

(01-19-2021, 01:10 PM)Winston Wrote: Black-&-White would still be possible, writing as #0000 for black, #8080 for gray, and #FFFF for white. #FF00 would be one color, #00FF would be the inverted color.

Using a different program, I tried looking for "03" hexadecimally in the beginning of picture files representing three colors, and changing it to "02", that didn't work.

Where is this "3" stored in an image file? Is it "2" because it starts from 0; 0=1, 1=2, 2=3? If that is the case, would changing it to 1 (=2) work?
Most image formats (except very basic BMP and TGA) are compressed, so you won't see the pixel values in a hex editor.

A possible solution for you is to color-index the image using a color palette that only contains the colors you want, that would give you 16 levels of luminosity and 16 levels across the color range (and you would use one byte per pixel when encoding the image). Or combos are possible as long as you have 256 colors total. And you can change the image by just changing colors in the color map. The GIF format is based in color-indexing (in fact, GIMP's color-indexed image mode is meant to edif GIFs), and is also a supported variant of PNG.
Reply


Messages In This Thread
Change Amount Channels In Pic - by Winston - 01-18-2021, 11:34 AM
RE: Change Amount Channels In Pic - by rich2005 - 01-18-2021, 12:20 PM
RE: Change Amount Channels In Pic - by Winston - 01-18-2021, 12:48 PM
RE: Change Amount Channels In Pic - by rich2005 - 01-18-2021, 02:09 PM
RE: Change Amount Channels In Pic - by Winston - 01-18-2021, 03:12 PM
RE: Change Amount Channels In Pic - by rich2005 - 01-18-2021, 03:36 PM
RE: Change Amount Channels In Pic - by denzjos - 01-18-2021, 03:54 PM
RE: Change Amount Channels In Pic - by eepjr24 - 01-18-2021, 04:18 PM
RE: Change Amount Channels In Pic - by Winston - 01-19-2021, 01:10 PM
RE: Change Amount Channels In Pic - by Ofnuts - 01-19-2021, 09:25 PM
RE: Change Amount Channels In Pic - by eepjr24 - 01-19-2021, 01:53 PM
RE: Change Amount Channels In Pic - by rich2005 - 01-19-2021, 01:59 PM
RE: Change Amount Channels In Pic - by Winston - 01-19-2021, 11:54 PM
RE: Change Amount Channels In Pic - by Ofnuts - 01-20-2021, 10:58 AM
RE: Change Amount Channels In Pic - by eepjr24 - 01-20-2021, 03:34 AM
RE: Change Amount Channels In Pic - by Winston - 01-24-2021, 12:15 AM

Forum Jump: