ChiriVulpes / MagicTranslator

Turning scanlation into a magical experience ✨
4 stars 1 forks source link

Use ImageMagick to downscale images, fall back to the existing downscale procedure when not set #157

Closed milleniumbug closed 1 year ago

milleniumbug commented 1 year ago

Partially fixes #156

Ideally we should be making the browser itself do it (because it clearly can do it, like, it can display images at a different scale), rather than relying on ImageMagick.

ChiriVulpes commented 1 year ago

Browsers lag when trying to display many huge files as thumbnails, and scans tend to be particularly huge. Thumbs are initially slow but subsequently they're instant. Using image magick to do it faster is a cool idea. Nice work!

milleniumbug commented 1 year ago

Oh, I meant more in the "use whatever browser uses to downscale images so we can downscale it ourselves" sense rather than removing thumbs altogether.

ChiriVulpes commented 1 year ago

Our options:

  1. Display the raw images. Causes lag when the images are really big. Not really an option, that's the reason why the project uses thumbnails to begin with.
  2. Scale down an image by drawing it into a smaller canvas directly. Does not interpolate and causes weird artefacting, or takes longer and causes fuzziness.
  3. Use a more accurate downscaling algorithm. Currently we're using the algorithm provided by the top answer on that question.
  4. Use an external program such as ImageMagick.