cantaloupe
cantaloupe copied to clipboard
How to extend the `quality`, `rotation` etc?
Since IIIF 3.0 it'S official, one is allowed to extend the server side API to enhance for example the quality
(like color, gray, bitonal). Now I want to provide a quality that's providing a transparent background. How would I add my own Quality, it seems that Quality.java
is quite static...
I guess another possible approach would be to hook into the rendering of the png
format (since it's required to provide transperancy) by implementing and setting processor.imageio.{format}.writer
, but this way the semantic of my own quality
couldn't be used via the API.
Another similar use case would be providing inverted images.
See also the Go-IIIF quality configuration. Also have a look at the following sections to get an impression on possible enhancements for image manipulation. Sure, about all examples have a real world benefit, but I guess it would be a good goal for Cantaloupe to provide a similar flexibility. Also note the non standard rotation feature, it would be great to hook into that URL part as well, for example to provide a auto generated rotation using OpenCV.
From what I can see I'm assuming that the resample
directory would be a good start to look into image manipulation, but I didn't find it's developer documentation (yet).
The current delegate mechanism seem to be tailored towards backend operations, with the exceptions of the very narrow use cases for image manipulation: overlays and redecation - in general the way extensibility is provided regarding image manipulation seems be too limited.
In general I would like to plug my quality
(as a Map<String, ? extends CustomQuality>
) somewere and don't care about the rest. And in a similar fashion I want to configure a default image pipeline as List<? extends ImageOperation>
.