Skip to main content

[JAI-IMAGEIO] Filestore operation with TYPE_FLOAT images

2 replies [Last post]
Anonymous

Hi everyone,

I'm having some problems saving some images with float data inside. I
get a blank image when trying to save it to a .tif
Am I doing something wrong? To confirm that this was due to the
type_float data, I even transformed a rgb image into a type_float and
tried to save it, but again, a blank image.

If I convert my type_float data into byte or short, I have a decent
output, but with data loss, so I really wanted to maintain the type of
my data. Is it not suported by imageio or am I doing something wrong?

Also, when I tried to save the data into a simple text file, it takes
forever to finish (+10minutes for a 500kb file!!)... I guess I'm
missing something here!

//Code extract
PlanarImage image = getPlanarImage();

final String tmp = localFileNameExtension.toLowerCase();
if (tmp.endsWith("tif") || (tmp.endsWith("tiff"))) {

JAI.create("filestore", image, dest, "tiff");

}
//End of code extract

Converting it to SHORT or even BYTE gives me some output:
//Code extract
ParameterBlock pbConvert = new ParameterBlock();
pbConvert.addSource(image);
pbConvert.add(DataBuffer.TYPE_SHORT);
image = JAI.create("format", pbConvert);
//End of code extract

Thank you all,
Felipe Quintella

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

Reply viewing options

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

Hello Felipe,
>
> I'm having some problems saving some images with float data inside. I
> get a blank image when trying to save it to a .tif
>

What are you using to view the tiff image?

I've used the CreateGLFPImageJAI code in
http://www.lac.inpe.br/~rafael.santos/JIPCookbook/1200-create-gl.jsp#ima...
to create a simple, gray-level floating-point image.

tiffinfo says:

TIFF Directory at offset 0x8 (8)
Image Width: 512 Image Length: 512
Bits/Sample: 32
Sample Format: IEEE floating point
Compression Scheme: None
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Rows/Strip: 8
Planar Configuration: single image plane

In Ubuntu, feh refuses to show the image, gqview shows a fully
tranparent image and ImageMagick's display shows a binary version of it.

I can display it using a surrogate image with the class
DisplayNBImageApp shown in
http://www.lac.inpe.br/~rafael.santos/JIPCookbook/2200-display-surrogate...

Please check these examples and let us know what happens.

cheers
Rafael

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

Felipe Quintella Correia

Hi Rafael,

Sorry for the delay on replying.

I'm using the standard Image Viewer from linux and GIMP.

After seeing your post, I realised that maybe the problem is really
that this programs can't make sense from a float value over 255, and
that may be what's causing them to display a blank image. If that's
what happening, them, no problems at all.

But that still leaves me with the question about the text file that
takes forever to be written, and this one I can't blame on any viewer!
hehe

I'm actually not so worried about this right now, I have some other
things to solve before I get back to this.

But thank you again! I'll try to load my saved images with a simple
JAI viewer and see what's inside them.

I'll post back here once I made some progress regarding this issue.

Cheers,
Felipe Quintella

2009/6/11 Rafael Santos :
> Hello Felipe,
>>
>> I'm having some problems saving some images with float data inside. I
>> get a blank image when trying to save it to a .tif
>>
>
> What are you using to view the tiff image?
>
> I've used the CreateGLFPImageJAI code in
> http://www.lac.inpe.br/~rafael.santos/JIPCookbook/1200-create-gl.jsp#ima...
> to create a simple, gray-level floating-point image.
>
> tiffinfo says:
>
> TIFF Directory at offset 0x8 (8)
>  Image Width: 512 Image Length: 512
>  Bits/Sample: 32
>  Sample Format: IEEE floating point
>  Compression Scheme: None
>  Photometric Interpretation: min-is-black
>  Samples/Pixel: 1
>  Rows/Strip: 8
>  Planar Configuration: single image plane
>
> In Ubuntu, feh refuses to show the image, gqview shows a fully tranparent
> image and ImageMagick's display shows a binary version of it.
>
>
> I can display it using a surrogate image with the class DisplayNBImageApp
> shown in
> http://www.lac.inpe.br/~rafael.santos/JIPCookbook/2200-display-surrogate...
>
> Please check these examples and let us know what happens.
>
> cheers
> Rafael
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

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