-
Notifications
You must be signed in to change notification settings - Fork 1
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
Quality in Image API v3: Replace color
with full
#25
Comments
A few thoughts & questions: The spec says:
If a server cannot respond with a colour image, will this change have an undesired effect on the ability for a server to respond appropriately? Or will clients need to inspect the images they return to figure out the colourspace? Would there ever be a time when Both Imagining a scenario: A client wishes to work with colour images only to feed into a machine-learning workflow built specifically on the need for colour images. If the client can't get a colour image, they expect to catch a 400 response and move on. Most services respond with a colour image with a request for Of less importance:
Is |
Hi @ahankinson
The issue with the current 2.1 spec is that it's not clear whether asking for So by renaming the quality It does mean that your use case would require the client to inspect the image to see whether it actually does contain non-gray pixels, but I think that is also the case with 2.1, it's just not clear (what do Loris, IIPImage etc do?) On the overloading of Also, I think we have to be careful about the phrase "color space", and be clear that the spec isn't mandating anything about the technical implementation of your returned images, other than the color values of pixels. For discussion later, maybe: Is it valid for a I think the answer is yes. If a client asks for See also @beaudet's comment - IIIF/api#1839 (comment) |
Thanks @tomcrane bitonal and grayscale are interesting cases, as it's possible to derive these from a colour image. So asking the server for bitonal when the original is colour is possible, but asking the server for colour when the original is bitonal should result in an error. If a client can only work with or wants a colour image, and they specifically request that, then I think they should receive an error when the server is unable to respond with one. I'm OK with having a |
I agree that |
One question that may complexify the problem space, or provide a litmus test for these parameter values and how they should be interpreted and used: what should be the value for a colorized image? 'full' or something 'more than full'? (or should it should be treated as a different image?) (I'm trying to understand how much 'full' means 'original' or something else) |
Using/retaining |
I think I understand the problem this issue is trying to address, but keeping 'bitonal' and 'gray' in the spec, while removing 'color', will lead to further behaviour inconsistencies about how servers can be expected to respond. While a variable response from 'default' can establish a sensible global response (that is, services can set a sensible default for their responses), 'full' will give services the ability to respond with variable image types and no real guarantee that what the client will receive will be what is expected. For example:
I think if the goal of this change is to clarify the behaviours of image servers and make it consistent, then we need to further clarify what the expected behaviours are. Without a definition of what 'full' actually means, I'm not sure that this change has that effect. |
It seems to me we could use any of |
I think there are two overlapping issues being discussed here. One is about commands, the The other is about information: does there exist in this image at least one pixel whose colour value is not R==G==B? Which is not a supported command, but an additional piece of information, like an extremely minimal palette service. Something an image server could support in some other way, to be defined. I agree with @ahankinson's use case, it's a valid scenario, and the proposed spec change clears up the ambiguity about whether it's possible to meet that use case by inspecting supported qualities in the info.json (it isn't). For the use case, information about the range of values present in the image's palette would then allow the client to request On a different note the proposed spec change includes this:
The "color values of the pixels it contains" could be clarified some more. What it's trying to say is, regardless of the bits per pixel, RGBa or whatever nature of the returned image:
|
As a point of order: Is this the right place for the conversation? I'm happy to continue it, but I seem to remember there being an agreement that TRC issues aren't the place to hash things out, and should be restricted to voting and minor clarifications. @hadro ? @glenrobson ? |
I have no strong feelings about this particular change, but a few notes below.
Loris makes a half-hearted attempt at checking if When it receives a request, it checks the colour model of the original image (RGB, CMYK, LA, etc.). If the colour model supports non-grey pixels, it allows the If you try to request an image in a quality that the colour profile doesn’t support, Loris returns a 400 error. Examples: https://iiif.wellcomecollection.org/image/M0000701.jpg/info.json (default, gray, bitonal) I don’t have details to hand, but Wellcome’s use case could make an argument in both directions (or for having both parameters, which is no decision at all). Some of Wellcome’s images have embedded colour profiles that popular browsers ignore, so in Loris we convert every image to sRGB before sending it as In favour of In favour of One subtlety in “does this image contain at least one non-grey pixel” is that it can vary on a per-transformation basis. If I have a massive image that’s entirely grey except one red pixel, eventually resizing will cause that red pixel to be lost. You could certainly work that out on every request, but I don’t think IIIF has a way to convey information about specific transformations? The e.g. You can’t say “quality |
@ahankinson Sorry for my delay, but here's my take: While these issues aren’t exactly the preferred place for lengthy discussion, as TRC process has evolved we've seen it a fair bit, and almost always helpfully. Here these seem like comments and clarifications useful to deciding the issue, and so while we won’t be changing the item being voted on the discussion may inform future issue creation |
I appreciate the perspectives voiced in this discussion as well as the issue that is being addressed. However I think there is potential for confusion in avoiding the use of plain language. One expects the term 'color' to be present when considering image attributes--especially if the plain language terms 'bitonal' and 'gray' are used in the same context. In the context of a greyscale image, would not 'full' also refer to the full spectrum of non-colour pixels to be returned? It strikes me that the definition 'The image is returned with as much color information as available' inherently implies that a colour images is requested; if so, then why not say so with 'color' instead of the ambiguous term 'full'? |
@hadro ok, thanks! |
I agree that using I'm also in favor of leaving |
Issue 25 (Quality in Image API v3: Replace
|
The ex officio members of the TRC have decided to reject this proposal for now, pending further research and discussion (see TRC process) |
Links
color
withfull
api#1839Background and Summary
The 2.1.1 spec says:
For example,
.../full/max/0/gray.jpg
would return a grayscale image.This can be confusing if the source image is grayscale, or uses a color space but happens to not have any non-gray pixels. Should a server offer the
color
quality? What should it return?The editors propose that potential ambiguity about whether a server should offer
color
, and what it should do with requests forcolor
, could be resolved by using the termfull
to avoid the implication that acolor
quality image should contain non-gray-shade pixels, or use particular color encodings.Proposed Solution
Possible qualities become:
bitonal
: The image returned is bitonal, where each pixel is either black or white.gray
: The image is returned in grayscale, where each pixel is black, white or any shade of gray in between.full
: The image is returned with as much color information as available.default
: The image is returned using the server’s default quality (e.g. full, gray or bitonal) for the image.A
full
image may contain only gray shades, if that is all that is available: it is legitimate for the server to listfull
in this case even if the response would be identical to that forgray
. No prescription about the color space to be used in the returned image is implied.There may be reasons for a server to return something different for
default
than forfull
(IIIF/api#1839 (comment)), sodefault
remains, and will continue to be the standard request, as in the current API.This appears to be quite a significant change, but the usage of explicit
color
is, we think, very low to non-existent.The text was updated successfully, but these errors were encountered: