About us | News | Contact
iText ® Licenses Support   
You are here: Home > Forums > iText in Action — Second Edition > Part 3: Essential iText skills > Chapter 10: Brighten up your document with color and images
User login
  • Request new password

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

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 Image class to find out what to do. Image has a method setAdditional() 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 with setAdditional() are added to the dictionary of the image XObject stream.
You can use simplifyColorspace() to replace CalRGB and CalGray colorspaces with DeviceRGB and DeviceGray.

  • Login to post comments
Content © 2010 1T3XT BVBA