cantaloupe-project / cantaloupe

High-performance dynamic image server in Java
https://cantaloupe-project.github.io/
Other
268 stars 109 forks source link

Borders around images, including tiles, showing with JaiProcessor #419

Open kefo opened 3 years ago

kefo commented 3 years ago

We're seeing borders around images and tiles for some but not all (I believe) of our Pyramidal TIFF images when using the JaiProcessor. (We switched from the Java2Processor, at least for now, because of slow performance compared to JaiProcessor.)

You can see the border when requesting an image from Cantaloupe, but I have also seen the borders using two different zoom viewers (Leaflet and OpenSeaDragon).

I can confirm that this does not happen when using the Java2dProcessor.

I can't find anything about this phenomenon in current or past GitHub issues or the Cantaloupe documentation.

Screen Shot 2020-12-08 at 18 41 42

We're running 4.1.6.

Any ideas?

kefo commented 3 years ago

An additional thought that might be relevant: We are using pyramidal TIFFS (as mentioned) with JPEG compression.

bingaman commented 3 years ago

I think this may be an artifact of scale using nearest neighbor interpolation on compressed ptiffs, would need to do more testing to confirm https://github.com/cantaloupe-project/cantaloupe/commit/7e0f135babf276c60db37d092c770c39fef18ead

If anyone has any other thoughts please chime in.

bingaman commented 3 years ago

I'm working with @kefo on this.

Seems that every single image coming out of cantaloupe has a 1px black border when using JAI. JAI is the only processor that is performant at all so I'm hoping we can figure out what's causing this.

bingaman commented 3 years ago

The black borders are caused by the unsharp mask. Removing that appears to have fixed the issue. So JAI+unsharp set to anything other than zero = black borders on every image.

kefo commented 3 years ago

I have a fix for this @adolski . Let me know if you would like a pull request.

adolski commented 3 years ago

@kefo Sure. Please submit against the release/4.1 branch.