-
Notifications
You must be signed in to change notification settings - Fork 2
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
reducing size of output jpg #23
Comments
(edited) |
I just want to add one remark here: unlike jpg rendering, png rendering of tiffs produces png having roughly twice the size of the initial tiff. It seems to me we might have an issue with jpg only. |
I'm in the train now but we should run the same kind of tests on jpg files yes, and compare the size of S3, tbrc.org and iiif |
(Aldo note that 53KB is 76% larger than 30KB, this is not something we can just ignore as a rounding error) |
As color vs. BW is concerned, see https://github.com/dbmdz/iiif-server-hymir/blob/master/src/main/java/de/digitalcollections/iiif/hymir/image/frontend/IIIFImageApiController.java#L125 where COLOR is hardcoded. We can fix that on our side since we have our own Controller Implementation. Posted an issue and suggestion on hymir repo: dbmdz/iiif-server-hymir#59 (implemented it on our server) |
Excellent yes, this is something we should implement and contribute to Hymir |
here is a perf report (after I got rid of a double call to S3 by modifying hymir Image Service implementation)- Most of the time is taken by Image processing and png processing takes approximately twice the time of jpg processing. |
Can you record the methodology and numbers in a Google doc? Also, maybe the cache mechanism should cache the result (png or jpg) instead of the source? It would probably make more sense in most cases |
@MarcAgate thanks for the initial data. Some questions:
|
|
Thanks for the Google doc, I missed it the first time, sorry! The round trip to Fuseki should happen only once per volume and not once per image request (is that the case?) so it's not the most important part I think (although of course we cannot ignore it). The iiif performance are a crucial part of the new system yes, there should be at least no regression from tbrc.org (if possible an improvement). So it's absolutely worth spending some time on it. Maybe Jim can work on the image processing part (what do you think Jim?) But the rest (S3 connection, cache, etc.) are important too. |
I have to finish audit tool (could be 6 weeks.) If I start building image processing, that would delay starting Asset Manager data plane & other things, although I think it would be a good thing to have in place where both Asset Manager and BUDA could get to it.
|
There's another optimization to be done around here I think. We could have a function that detects if the image needs to be transformed, and if not the |
bad news, none of the viewers can be asked to use png by default, see so we need to make the jpg output better |
@berger-n is it feasible to package and use our fork of openseadragon? if it requires some code change (which I suspect it will), it would be best to create a new branch ( |
I think we have reached a first optimized state at this point:
At this point:
|
Great job, that's really a huge improvement, and now we have a production-ready server, thanks! The 3 final points are less important I think as they don't hinder the performance too much and there's not much we can do about it... closing |
Context: on S3, the tif corresponding to this image is below 30KB, but the output jpg on the iiif server is 461KB.
On the current website (using JAI), the corresponding image (here) is a png of about 30KB.
The png version is only 53KB, much more reasonable but still significantly more than the current website.
It seems hymir just uses the basic javax.imageio functions (see here) as provided by twelvemonkeys. The parameters that we can use in JPEGImageWriteParam look very limited. There doesn't seem to be a much better option in Java though.
This is an important issue for various reasons:
Here are a few ideas to start dealing with the issue:
The text was updated successfully, but these errors were encountered: