Comments (5)
I may be missing sth, but those are actually all reasons for using IIIF ;)
- Cropping images is done server-side via API request, you directly get the snippets returned based on the coordinates already present in the OCR files
- Contrary to downloading the image and doing some cutting/preprocessing locally (how?), IIIF does all that for you in the request
- The returned image snippets work across browsers
- The functionality is based on an established and internationally used API standard, which seems much more general to me
- Everyone with IIIF Image API can use the feature, they only need to supply the baseURL for the IIIF API (e.g. via parameter/config file)
- We already have a working JS implementation for this in neat
I could probably think of more reasons pro IIIF.
from dinglehopper.
Reasons I am contemplating only working with local files:
- I am almost exclusively working with local files
- The SBB has no IIIF in the METS files (All the IIIF I have in the files is from URLs I manipulated myself)
- IIIF is not even (cleanly) detectable if there were IIIF URLs in there
- So IIIF would require extra configuration (baseURL)
- Working with the local files would "just work", at least for OCR-D workspaces where I can tell OCR-D to download the files locally
- What about non-IIIF workspaces/files?
- The implementation in neat may work but I don't see how to use it, i.e. cropping using CSS is just as easy
Not the last word spoken, but I tend to work with local files. Even TIFF support looks doable.
from dinglehopper.
CSS experiments:
This means:
- Cropping using CSS is easy
- No TIFF
from dinglehopper.
Based on your example, here is how this can also be done serverside just with the pixel information you already have in the OCR and an awesome API.
E.g. the IIIF-URL for your example looks like this:
{baseurl}/{identifier}/{x,y,w,h}/{size}/{rotation}/default.{jpg|png|tif}
50% scaled:
Or get PNG
Even TIF! - except it wont render in any web browser ;)
If you replace {baseurl}{identifier}
with those of any other institution that implements the IIIF Image API, this will always work.
See just a few example (different documents of course)
BSB
https://api.digitale-sammlungen.de/iiif/image/v2/bsb00103155_00013/149,450,1244,228/1200,/0/default.jpg
https://api.digitale-sammlungen.de/iiif/image/v2/bsb00103155_00013/149,450,1244,228/600,/0/default.jpg
https://api.digitale-sammlungen.de/iiif/image/v2/bsb00103155_00013/full/full/0/default.jpg
ÖNB
https://iiif.onb.ac.at/images/ABO/Z165851607/00000001/149,450,1244,228/1200,/0/default.jpg
https://iiif.onb.ac.at/images/ABO/Z165851607/00000001/149,450,1244,228/600,/0/default.jpg
https://iiif.onb.ac.at/images/ABO/Z165851607/00000001/full/full/0/default.jpg
BnF Gallica
https://gallica.bnf.fr/iiif/ark:/12148/btv1b9055204k/f1/149,450,1244,228/1200,/0/default.jpg
https://gallica.bnf.fr/iiif/ark:/12148/btv1b9055204k/f1/149,450,1244,228/600,/0/default.jpg
https://gallica.bnf.fr/iiif/ark:/12148/btv1b9055204k/f1/full/full/0/default.jpg
There are a few hundred libraries, museums and archives worldwide that implement this, and growing.
There are Python libraries for it:
Bottom line - IIIF is fun ;)
from dinglehopper.
The problem is: How do I know the IIIF URL?
- In my example (https://qurator-data.de/~mike.gerber/experiments/image-cropping-using-css/PPN77164308X/mets.xml) there are IIIF URLs in the BEST file group. Not because they were in the original, but because I put them there using ppn2ocr.
- How do I know these are IIIF URLs other than guessing?
Thinking about it, the first idea is following
-
OCR-D interface
- If the user tells me to use IIIF, dinglehopper will assume that the URLs in the filegroup are IIIF and use that
- If input is PNG/JPG, use CSS cropping
- Otherwise complain that we can't display TIFF
-
CLI interface
- If the user gives IIIF URL, use that
- If input (read from PAGE XML) is PNG/JPG, use CSS cropping
- Otherwise complain that we can't display TIFF
To be honest, if the browsers would support TIFF I would not consider IIIF at all because cropping an image is trivial and supporting IIIF here just adds complexity by requiring a IIIF URL etc.
from dinglehopper.
Related Issues (20)
- Test cli_line_dirs
- Tests broken, again HOT 4
- Review API w.r.t. to keyword only arguments HOT 1
- Tests failing + Wrong badge HOT 5
- mypy vs pre-commit mypy HOT 2
- newlines not removed in plain_extract HOT 5
- Windows support HOT 5
- Python 3.12 support broken HOT 3
- Confusing "Tests Report" in GH Actions
- Test CLIs
- Test reports broken HOT 3
- Add TEI support
- Review changes of #83
- setup.cfg → pyproject.toml HOT 3
- Install is now broken HOT 2
- GitHub Actions HOT 1
- Review multimethod dependency
- Regression with newest ocrd version HOT 4
- dinglehopper --version, ocrd-dinglehopper --version HOT 1
- Detect if no text was extracted / if there are grave inconsistencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dinglehopper.