How do you set the colorspace of an image?
Submitted by mschwartzman on Thu, 03/31/2011 - 21:08
I'm working with a J2C (JPEG2000 codestream) file and I need to be able to set the colorspace. I found getColorspace() but no setColorspace(int c). Also, the bands are BGR not RGB. Is there a way to specify the band order?
Thanks,
Martin
- Login to post comments
Content © 2010 1T3XT BVBA

setAdditional()
Submitted by Bruno Lowagie on Fri, 04/01/2011 - 08:59.I fear you have to dig into ISO-32000-1 and into the code of the
Imageclass to find out what to do.Imagehas a methodsetAdditional()that allows you to add additional keys that go into the image dictionary.The only extra key that is mentioned for the moment, is the
/Colorspace. But you could add other keys, for instance containing a measurements entry. All the keys added withsetAdditional()are added to the dictionary of the image XObject stream.You can use
simplifyColorspace()to replace CalRGB and CalGray colorspaces with DeviceRGB and DeviceGray.