-
-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenSlide images aren't automatically converted from ARGB #11
Comments
This commit makes it a bit more automatic: This adds a new coding type for ARGB (meaning Cairo-style argb). Operations like flip and crop will work on ARGB-coded images, but things like arithmetic will fail until you decode with argb2rgba. It will convert automatically for file save operations. There's a similar commit on nip2 master to make it argb2rgba for you. Maybe this isn't the best approach though. I modelled it on the behaviour with Radiance (HDR) images, where it makes sense because you often want to manipulate a rad image without going through float. But openslide does not support write, so perhaps there's no reason for vips to support Cairo coding? Maybe openslide read should simply always decode. |
I've reverted that commit. I'll put the argb -> rgba stuff back into openslide2vips, it makes more sense since we never want to expose argb format really |
Sounds good to me. Is this change likely to make it into a 7.28.x stable release? |
It sounds rather intrusive :-( but things do seem badly broken right now. |
libvips/7.28 HEAD now has a redone openslide read, here's the commit: it seems to work for me, hopefully. If you have time to test (esp. with images with an interesting alpha channel) that would be fantastic. I'll do a new 7.28 including this patch in a few days. |
It works for me, thanks. (What is the syntax for passing loader arguments to nip2? |
Great, thanks for testing, I'll close the issue. The openslide loader only supports vips8 arguments, and nip2 is going to stay on the vips7 API for a while yet. Supporting vips7 loader args would involve adding some code to: https://github.com/jcupitt/libvips/blob/master/libvips/deprecated/im_openslide2vips.c See the vips7 tiff loader for an example: https://github.com/jcupitt/libvips/blob/master/libvips/deprecated/im_tiff2vips.c Or I guess your original patch would have had this. I'll have a look. |
This commit to 7.28 adds :level,associated options to the vips7 api for openslide load: $ header CMU-2.svs |
Reading an OpenSlide image produces ARGB image data, which doesn't display correctly in nip2 and causes
vips openslideload
to write output images with incorrect color channels. There's also no hint in the image header (e.g. VipsInterpretation?) thatim_argb2rgba
is needed.Is this the correct behavior? I can understand that VIPS may not want to mangle channels without explicit instructions, but it does mean that the most straightforward approaches to loading slides will always be wrong.
(cc: @agoode)
The text was updated successfully, but these errors were encountered: