Extension talk:Proofread Page/Page viewer
Latest comment: 1 year ago by Sohom Datta in topic Read pixels in the scanned image from a script
Read pixels in the scanned image from a script
editHi,
Is it possible, from a script, to read (and maybe modify) pixels from the scanned image (at Wikisource)? Unless I'm wrong, the Openseadragon API allows to zoom and pan the image, but not to actually read or modify pixels, and using the standard Canvas.getImageData API (something like $("canvas")[0].getContext("2d").getImageData(0, 0, 200, 200)
) returns a CORS security error.
The only way I could find to avoid the CORS error was to load the image again, which looks like wasting network resources (and worsening loading time for the user). Accessing the image displayed by Proofreader and OSD would be much more convenient. Seudo (talk) 10:14, 10 March 2023 (UTC)
- @Seudo Can you file a phabricator ticket documenting what you are trying to do, we can support if there isn't a easy to way to do it. Sohom Datta (talk) 21:30, 8 June 2023 (UTC)