Skip to main content

[JAI] tiff icc_profile

9 replies [Last post]
Anonymous

Ok, I really need help.

I follow the 6 steps below to use ICC_Profiles embeded in tiff file, but
I found the metadata in the tiff ICC Profile are ranged form 0 to 255,
they cannot be fit into a byte[]. what I can do?

url:

http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...

1. Obtain the image metadata from ImageReader.getImageMetadata(int)
2. Extract the ICC profile field and its value.
3. Create an ICC_ColorSpace from an ICC_Profile created from the ICC
profile field data using ICC_Profile.getInstance(byte[]).
4. Create an ImageTypeSpecifier from the new color space using one of
its factory methods which accepts an ICC_ColorSpace.
5. Create a compatible ImageReadParam and set the ImageTypeSpecifier
using ImageReadParam.setDestinationType(javax.imageio.ImageTypeSpecifier).
6. Pass the parameter object to the appropriate read method.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

On Sat, 21 May 2005 youjun.guo@yale.edu wrote:

> Yes I did, but still cannot get through.
>
> It gives no clue about the structure of ICCProfile metadata, and I
> cannot find schema for jpeg2000 ICCProfile part from jpeg2000's web site
> neither.

I am afraid you might have to buy the format doc. Either that or this book

D. S. Taubman, M. W. Marcellin, "JPEG2000 ? Image Compression Fundamentals,
Standards, and Practice," Kluwer Academic Publishers, 2002.

perhaps from http://www.booksense.com/

> I failed to append original tiff icc profile data to jpeg2000's
> IIOMatedata. Because it's a piece of text info, and the node return from
> IIOMetadata's getAsTree method is of type IIOMetadataNode, its
> appendChild method only accept IIOMetadataNode as param(it will cause
> exception being passed a Node), and I don't know how to build a text
> node of IIOMetadataNode type (no such constructor or factory class).
>
> I also tried to append a dummy node to jpeg2000 ICCProfile node:
>
> IIOMetadataNode
> metadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());
>
> IIOMetadataNode
> profile=(IIOMetadataNode)metadataNode.getElementsByTagName("ICCProfile").item(0);
>
> profile.appendChild((Node)new IIOMetadataNode("test"));
>
> it didn't cause any error, but acturally nothing was added to output
> metadata. the output jp2 file still get a empty node.
>
> Any clue why?

>From the code it looks as if the ICCProfile information is expected to be
attached as an

http://java.sun.com/j2se/1.5.0/docs/api/java/awt/color/ICC_Profile.html

object using this method

http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/IIOMetadataNode.html#setUserObject(java.lang.Object)

The method, precedence, and approximation are bytes and the
enumeratedcolorspace value is an int.

Brian

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

youjun.guo@yale.edu

Hi, Brian,

I did like following, but still get empty node from output
jp2 files. I am not sure If the j2kwriter.write method really take care
of the metadata param I passed, or just simplely ignore it without any
exception.

IIOMetadataNode
jp2MetadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());

IIOMetadataNode
tifProfileNode=(IIOMetadataNode)tifMetadataNode.getElementsByTagName("TIFFUndefined").item(0);
IIOMetadataNode
jp2ProfileNode=(IIOMetadataNode)jp2MetadataNode.getElementsByTagName("ICCProfile").item(0);

String tifProfileBytes = tifMetadataNode.getAttribute("value");
String [] bytes=tifprofileBytes.split(",");
byte [] ba=new byte[bytes.length];

for(int
i=0;i

jp2ProfileNode.setUserObject(ICC_Profile.getInstance(ba));

writer.write(jp2Metadata,new IIOImage(image, null, null),encodeParam);

Quoting Brian Burkhalter :

> On Sat, 21 May 2005 youjun.guo@yale.edu wrote:
>
> > Yes I did, but still cannot get through.
> >
> > It gives no clue about the structure of ICCProfile metadata, and
> I
> > cannot find schema for jpeg2000 ICCProfile part from jpeg2000's web
> site
> > neither.
>
> I am afraid you might have to buy the format doc. Either that or this
> book
>
> D. S. Taubman, M. W. Marcellin, "JPEG2000 ? Image Compression
> Fundamentals,
> Standards, and Practice," Kluwer Academic Publishers, 2002.
>
> perhaps from http://www.booksense.com/
>
> > I failed to append original tiff icc profile data to jpeg2000's
> > IIOMatedata. Because it's a piece of text info, and the node return
> from
> > IIOMetadata's getAsTree method is of type IIOMetadataNode, its
> > appendChild method only accept IIOMetadataNode as param(it will
> cause
> > exception being passed a Node), and I don't know how to build a
> text
> > node of IIOMetadataNode type (no such constructor or factory
> class).
> >
> > I also tried to append a dummy node to jpeg2000 ICCProfile node:
> >
> > IIOMetadataNode
> >
>
metadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());
> >
> > IIOMetadataNode
> >
>
profile=(IIOMetadataNode)metadataNode.getElementsByTagName("ICCProfile").item(0);
> >
> > profile.appendChild((Node)new IIOMetadataNode("test"));
> >
> > it didn't cause any error, but acturally nothing was added to
> output
> > metadata. the output jp2 file still get a empty
> node.
> >
> > Any clue why?
>
> >From the code it looks as if the ICCProfile information is expected
> to be
> attached as an
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/awt/color/ICC_Profile.html
>
> object using this method
>
>
http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/IIOMetadataNode.html#setUserObject(java.lang.Object)
>
> The method, precedence, and approximation are bytes and the
> enumeratedcolorspace value is an int.
>
> Brian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

youjun.guo@yale.edu

Hi,Brian:

Now I am sure J2Kwriter didn't take care the metadata param. I pass
J2Kwriter a tif Metadata! There is no Exception, and it still worked fine!

Iterator writers = ImageIO.getImageWritersByFormatName("jpeg2000");
ImageWriter writer = (ImageWriter)writers.next();
writer.write(tifMetadata,new IIOImage(image, null,
tifMetadata),encodeParam);

Quoting youjun.guo@yale.edu:

> Hi, Brian,
>
> I did like following, but still get empty node from
> output
> jp2 files. I am not sure If the j2kwriter.write method really take
> care
> of the metadata param I passed, or just simplely ignore it without
> any
> exception.
>
> IIOMetadataNode
>
jp2MetadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());
>
> IIOMetadataNode
>
tifProfileNode=(IIOMetadataNode)tifMetadataNode.getElementsByTagName("TIFFUndefined").item(0);
> IIOMetadataNode
>
jp2ProfileNode=(IIOMetadataNode)jp2MetadataNode.getElementsByTagName("ICCProfile").item(0);
>
> String tifProfileBytes = tifMetadataNode.getAttribute("value");
>
> String [] bytes=tifprofileBytes.split(",");
> byte [] ba=new byte[bytes.length];
>
> for(int
> i=0;i >
>
> jp2ProfileNode.setUserObject(ICC_Profile.getInstance(ba));
>
> writer.write(jp2Metadata,new IIOImage(image, null,
> null),encodeParam);
>
>
>
>
>
>
>
>
>
>
>
>
>
> Quoting Brian Burkhalter :
>
> > On Sat, 21 May 2005 youjun.guo@yale.edu wrote:
> >
> > > Yes I did, but still cannot get through.
> > >
> > > It gives no clue about the structure of ICCProfile metadata,
> and
> > I
> > > cannot find schema for jpeg2000 ICCProfile part from jpeg2000's
> web
> > site
> > > neither.
> >
> > I am afraid you might have to buy the format doc. Either that or
> this
> > book
> >
> > D. S. Taubman, M. W. Marcellin, "JPEG2000 ? Image Compression
> > Fundamentals,
> > Standards, and Practice," Kluwer Academic Publishers, 2002.
> >
> > perhaps from http://www.booksense.com/
> >
> > > I failed to append original tiff icc profile data to jpeg2000's
> > > IIOMatedata. Because it's a piece of text info, and the node
> return
> > from
> > > IIOMetadata's getAsTree method is of type IIOMetadataNode, its
> > > appendChild method only accept IIOMetadataNode as param(it will
> > cause
> > > exception being passed a Node), and I don't know how to build a
> > text
> > > node of IIOMetadataNode type (no such constructor or factory
> > class).
> > >
> > > I also tried to append a dummy node to jpeg2000 ICCProfile
> node:
> > >
> > > IIOMetadataNode
> > >
> >
>
metadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());
> > >
> > > IIOMetadataNode
> > >
> >
>
profile=(IIOMetadataNode)metadataNode.getElementsByTagName("ICCProfile").item(0);
> > >
> > > profile.appendChild((Node)new IIOMetadataNode("test"));
> > >
> > > it didn't cause any error, but acturally nothing was added to
> > output
> > > metadata. the output jp2 file still get a empty
> > node.
> > >
> > > Any clue why?
> >
> > >From the code it looks as if the ICCProfile information is
> expected
> > to be
> > attached as an
> >
> >
> http://java.sun.com/j2se/1.5.0/docs/api/java/awt/color/ICC_Profile.html
> >
> > object using this method
> >
> >
>
http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/IIOMetadataNode.html#setUserObject(java.lang.Object)
> >
> > The method, precedence, and approximation are bytes and the
> > enumeratedcolorspace value is an int.
> >
> > Brian
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> > For additional commands, e-mail: interest-help@jai.dev.java.net
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

Youjun,

Would you be able to provide a complete end-to-end test case which is
self-contained and requires no editing (not even to change the file paths) as
well as any necessary data? You could send that to me privately if you
prefer.

Thanks,

Brian

On Tue, 24 May 2005 youjun.guo@yale.edu wrote:

> Hi,Brian:
>
> Now I am sure J2Kwriter didn't take care the metadata param. I pass
> J2Kwriter a tif Metadata! There is no Exception, and it still worked fine!
>
> Iterator writers = ImageIO.getImageWritersByFormatName("jpeg2000");
> ImageWriter writer = (ImageWriter)writers.next();
> writer.write(tifMetadata,new IIOImage(image, null,
> tifMetadata),encodeParam);
>
>
> Quoting youjun.guo@yale.edu:
>
> > Hi, Brian,
> >
> > I did like following, but still get empty node from
> > output
> > jp2 files. I am not sure If the j2kwriter.write method really take
> > care
> > of the metadata param I passed, or just simplely ignore it without
> > any
> > exception.
> >
> > IIOMetadataNode
> >
> jp2MetadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());
> >
> > IIOMetadataNode
> >
> tifProfileNode=(IIOMetadataNode)tifMetadataNode.getElementsByTagName("TIFFUndefined").item(0);
> > IIOMetadataNode
> >
> jp2ProfileNode=(IIOMetadataNode)jp2MetadataNode.getElementsByTagName("ICCProfile").item(0);
> >
> > String tifProfileBytes = tifMetadataNode.getAttribute("value");
> >
> > String [] bytes=tifprofileBytes.split(",");
> > byte [] ba=new byte[bytes.length];
> >
> > for(int
> > i=0;i > >
> >
> > jp2ProfileNode.setUserObject(ICC_Profile.getInstance(ba));
> >
> > writer.write(jp2Metadata,new IIOImage(image, null,
> > null),encodeParam);
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Quoting Brian Burkhalter :
> >
> > > On Sat, 21 May 2005 youjun.guo@yale.edu wrote:
> > >
> > > > Yes I did, but still cannot get through.
> > > >
> > > > It gives no clue about the structure of ICCProfile metadata,
> > and
> > > I
> > > > cannot find schema for jpeg2000 ICCProfile part from jpeg2000's
> > web
> > > site
> > > > neither.
> > >
> > > I am afraid you might have to buy the format doc. Either that or
> > this
> > > book
> > >
> > > D. S. Taubman, M. W. Marcellin, "JPEG2000 ? Image Compression
> > > Fundamentals,
> > > Standards, and Practice," Kluwer Academic Publishers, 2002.
> > >
> > > perhaps from http://www.booksense.com/
> > >
> > > > I failed to append original tiff icc profile data to jpeg2000's
> > > > IIOMatedata. Because it's a piece of text info, and the node
> > return
> > > from
> > > > IIOMetadata's getAsTree method is of type IIOMetadataNode, its
> > > > appendChild method only accept IIOMetadataNode as param(it will
> > > cause
> > > > exception being passed a Node), and I don't know how to build a
> > > text
> > > > node of IIOMetadataNode type (no such constructor or factory
> > > class).
> > > >
> > > > I also tried to append a dummy node to jpeg2000 ICCProfile
> > node:
> > > >
> > > > IIOMetadataNode
> > > >
> > >
> >
> metadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());
> > > >
> > > > IIOMetadataNode
> > > >
> > >
> >
> profile=(IIOMetadataNode)metadataNode.getElementsByTagName("ICCProfile").item(0);
> > > >
> > > > profile.appendChild((Node)new IIOMetadataNode("test"));
> > > >
> > > > it didn't cause any error, but acturally nothing was added to
> > > output
> > > > metadata. the output jp2 file still get a empty
> > > node.
> > > >
> > > > Any clue why?
> > >
> > > >From the code it looks as if the ICCProfile information is
> > expected
> > > to be
> > > attached as an
> > >
> > >
> > http://java.sun.com/j2se/1.5.0/docs/api/java/awt/color/ICC_Profile.html
> > >
> > > object using this method
> > >
> > >
> >
> http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/IIOMetadataNode.html#setUserObject(java.lang.Object)
> > >
> > > The method, precedence, and approximation are bytes and the
> > > enumeratedcolorspace value is an int.
> > >
> > > Brian
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> > > For additional commands, e-mail: interest-help@jai.dev.java.net
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> > For additional commands, e-mail: interest-help@jai.dev.java.net
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Advanced Development, Graphics and Media
Software Chief Technology Office
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

Cast:

byte b = (byte)129

etc.

Brian

On Wed, 18 May 2005 youjun.guo@yale.edu wrote:

> Ok, I really need help.
>
> I follow the 6 steps below to use ICC_Profiles embeded in tiff file, but
> I found the metadata in the tiff ICC Profile are ranged form 0 to 255,
> they cannot be fit into a byte[]. what I can do?
>
> url:
>
> http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...
>
> 1. Obtain the image metadata from ImageReader.getImageMetadata(int)
> 2. Extract the ICC profile field and its value.
> 3. Create an ICC_ColorSpace from an ICC_Profile created from the ICC
> profile field data using ICC_Profile.getInstance(byte[]).
> 4. Create an ImageTypeSpecifier from the new color space using one of
> its factory methods which accepts an ICC_ColorSpace.
> 5. Create a compatible ImageReadParam and set the ImageTypeSpecifier
> using ImageReadParam.setDestinationType(javax.imageio.ImageTypeSpecifier).
> 6. Pass the parameter object to the appropriate read method.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

youjun.guo@yale.edu

Hi, Brian,

Thanks, it works, but I still cannot reach my final goal. I am working
on some tiff files which come with adobe rgb(98) color profiles, I tried
to convert them to jpeg2000 format using jai, and the imageio j2k plugin
added a srgb color profile to output jepg2000 files by default, so the
color of output jp2 files looked differently from original tif files.

I tried to use the original color profile to create a image object and
then converted it to jp2(use your cast hint), but the output jp2 file
still looks differently from original file. Now I geuss I have to find a
way to change jpeg2000 file's color profile form srgb to adobe rgb, can
you give me some suggestions?

Thank you very much!

Youjun

Quoting Brian Burkhalter :

> Cast:
>
> byte b = (byte)129
>
> etc.
>
> Brian
>
> On Wed, 18 May 2005 youjun.guo@yale.edu wrote:
>
> > Ok, I really need help.
> >
> > I follow the 6 steps below to use ICC_Profiles embeded in tiff
> file, but
> > I found the metadata in the tiff ICC Profile are ranged form 0 to
> 255,
> > they cannot be fit into a byte[]. what I can do?
> >
> > url:
> >
> >
>
http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...
> >
> > 1. Obtain the image metadata from
> ImageReader.getImageMetadata(int)
> > 2. Extract the ICC profile field and its value.
> > 3. Create an ICC_ColorSpace from an ICC_Profile created from the
> ICC
> > profile field data using ICC_Profile.getInstance(byte[]).
> > 4. Create an ImageTypeSpecifier from the new color space using
> one of
> > its factory methods which accepts an ICC_ColorSpace.
> > 5. Create a compatible ImageReadParam and set the
> ImageTypeSpecifier
> > using
> ImageReadParam.setDestinationType(javax.imageio.ImageTypeSpecifier).
> > 6. Pass the parameter object to the appropriate read method.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

Youjun,

Did you supply an IIOImageMetadata object to the JPEG 2000 ImageWriter and
include within it a JPEG2000ColorSpecificationBox containing an ICCProfile?
The JPEG 2000 image metadata DTD is provided at:

http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...

Brian

On Thu, 19 May 2005 youjun.guo@yale.edu wrote:

> Thanks, it works, but I still cannot reach my final goal. I am working
> on some tiff files which come with adobe rgb(98) color profiles, I tried
> to convert them to jpeg2000 format using jai, and the imageio j2k plugin
> added a srgb color profile to output jepg2000 files by default, so the
> color of output jp2 files looked differently from original tif files.
>
> I tried to use the original color profile to create a image object and
> then converted it to jp2(use your cast hint), but the output jp2 file
> still looks differently from original file. Now I geuss I have to find a
> way to change jpeg2000 file's color profile form srgb to adobe rgb, can
> you give me some suggestions?

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

youjun.guo@yale.edu

Hi,Brian,

Yes I did, but still cannot get through.

It gives no clue about the structure of ICCProfile metadata, and I
cannot find schema for jpeg2000 ICCProfile part from jpeg2000's web site
neither.

I failed to append original tiff icc profile data to jpeg2000's
IIOMatedata. Because it's a piece of text info, and the node return from
IIOMetadata's getAsTree method is of type IIOMetadataNode, its
appendChild method only accept IIOMetadataNode as param(it will cause
exception being passed a Node), and I don't know how to build a text
node of IIOMetadataNode type (no such constructor or factory class).

I also tried to append a dummy node to jpeg2000 ICCProfile node:

IIOMetadataNode
metadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());

IIOMetadataNode
profile=(IIOMetadataNode)metadataNode.getElementsByTagName("ICCProfile").item(0);

profile.appendChild((Node)new IIOMetadataNode("test"));

it didn't cause any error, but acturally nothing was added to output
metadata. the output jp2 file still get a empty node.

Any clue why?

Thanks!

Quoting Brian Burkhalter :

> Youjun,
>
> Did you supply an IIOImageMetadata object to the JPEG 2000
> ImageWriter and
> include within it a JPEG2000ColorSpecificationBox containing an
> ICCProfile?
> The JPEG 2000 image metadata DTD is provided at:
>
>
http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...
>
> Brian
>
> On Thu, 19 May 2005 youjun.guo@yale.edu wrote:
>
> > Thanks, it works, but I still cannot reach my final goal. I am
> working
> > on some tiff files which come with adobe rgb(98) color profiles, I
> tried
> > to convert them to jpeg2000 format using jai, and the imageio j2k
> plugin
> > added a srgb color profile to output jepg2000 files by default, so
> the
> > color of output jp2 files looked differently from original tif
> files.
> >
> > I tried to use the original color profile to create a image object
> and
> > then converted it to jp2(use your cast hint), but the output jp2
> file
> > still looks differently from original file. Now I geuss I have to
> find a
> > way to change jpeg2000 file's color profile form srgb to adobe rgb,
> can
> > you give me some suggestions?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

youjun.guo@yale.edu

Sorry I mean the schema you refer to me with a line like
. It gives no clue
about the structure of ICCProfile metadata

Quoting youjun.guo@yale.edu:

> Hi,Brian,
>
> Yes I did, but still cannot get through.
>
> It gives no clue about the structure of ICCProfile metadata, and I
> cannot find schema for jpeg2000 ICCProfile part from jpeg2000's web
> site
> neither.
>
> I failed to append original tiff icc profile data to jpeg2000's
> IIOMatedata. Because it's a piece of text info, and the node return
> from
> IIOMetadata's getAsTree method is of type IIOMetadataNode, its
> appendChild method only accept IIOMetadataNode as param(it will
> cause
> exception being passed a Node), and I don't know how to build a
> text
> node of IIOMetadataNode type (no such constructor or factory class).
>
>
> I also tried to append a dummy node to jpeg2000 ICCProfile node:
>
> IIOMetadataNode
>
metadataNode=(IIOMetadataNode)jp2Metadata.getAsTree(jp2Metadata.getNativeMetadataFormatName());
>
> IIOMetadataNode
>
profile=(IIOMetadataNode)metadataNode.getElementsByTagName("ICCProfile").item(0);
>
> profile.appendChild((Node)new IIOMetadataNode("test"));
>
> it didn't cause any error, but acturally nothing was added to
> output
> metadata. the output jp2 file still get a empty node.
>
> Any clue why?
>
> Thanks!
>
> Quoting Brian Burkhalter :
>
> > Youjun,
> >
> > Did you supply an IIOImageMetadata object to the JPEG 2000
> > ImageWriter and
> > include within it a JPEG2000ColorSpecificationBox containing an
> > ICCProfile?
> > The JPEG 2000 image metadata DTD is provided at:
> >
> >
>
http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...
> >
> > Brian
> >
> > On Thu, 19 May 2005 youjun.guo@yale.edu wrote:
> >
> > > Thanks, it works, but I still cannot reach my final goal. I am
> > working
> > > on some tiff files which come with adobe rgb(98) color profiles,
> I
> > tried
> > > to convert them to jpeg2000 format using jai, and the imageio
> j2k
> > plugin
> > > added a srgb color profile to output jepg2000 files by default,
> so
> > the
> > > color of output jp2 files looked differently from original tif
> > files.
> > >
> > > I tried to use the original color profile to create a image
> object
> > and
> > > then converted it to jp2(use your cast hint), but the output
> jp2
> > file
> > > still looks differently from original file. Now I geuss I have
> to
> > find a
> > > way to change jpeg2000 file's color profile form srgb to adobe
> rgb,
> > can
> > > you give me some suggestions?
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> > For additional commands, e-mail: interest-help@jai.dev.java.net
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net