Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

ColorModel, tif and JAI problem

Thread view: 
ownowl - 11 Aug 2006 16:44 GMT
Hello

I need to modify the color model of a PlanarImage (colors to grays scale
and other operations)

The original planarImage is built with a byte array that come from a
tiff file :

            SeekableStream stream = new ByteArraySeekableStream(data);
            RenderedImage im = JAI.create("stream", stream);
            planarImage = PlanarImage.wrapRenderedImage(im);

planarImage is a instance of RenderedOp
the sampleModel of the planarImage is a PixelInterleavedSampleModel
the colorModel of the planarImage is a IndexColorModel

I tried it since several hours without success. So I not found in JAI
documentation all string_option of JAI.create(string_option, object) and
their signification.

thank for all idea
Olivier
ownowl - 11 Aug 2006 18:39 GMT
ownowl a écrit :
> Hello
>
[quoted text clipped - 11 lines]
> the sampleModel of the planarImage is a PixelInterleavedSampleModel
> the colorModel of the planarImage is a IndexColorModel

I tried that :

            ImageLayout layout = new ImageLayout();
            ColorModel cm = new
ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), new
int[] { 8, 8, 8 }, false, true, Transparency.OPAQUE, DataBuffer.TYPE_BYTE);

            layout.setColorModel(cm);
            RenderingHints hints = new
RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);

            ParameterBlockJAI pb = new ParameterBlockJAI("format");
            pb.addSource(planarImage);
            planarImage = JAI.create("format", pb, hints);

with using ColorSpace.CS_GRAY parameter for the ColorSpace.getInstance()
methode I get a gray scale level image.

But I can not modify the intensity of colors or gray scale level.
A idea ?

Olivier


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.