Skip to content

Wrong data for TIFF images #215

Open
@akidee

Description

@akidee

Example:

ImagePlus img = new ImagePlus(tiffFile);
L.i(img.getWidth()+" x "+img.getHeight());
for (int i = 500; i < 600; i++) {
	int[] px = img.getPixel(i, i);
	out.println(i+": "+Arrays.toString(px));
}

Dimensions are always correct, data is correct for other image formats, but for TIFFs (here, 16 bit uncompressed) only the first channel shows values > 0, which is incorrect:

6000 x 4000
 500: [122, 0, 0, 0]
 501: [65325, 0, 0, 0]
 502: [65471, 0, 0, 0]
 503: [28, 0, 0, 0]
 504: [65202, 0, 0, 0]
 505: [65281, 0, 0, 0]
 506: [65021, 0, 0, 0]

How can I get correct values?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions