lovasoa / dezoomify

Dezoomify is a web application to download zoomable images from museum websites, image galleries, and map viewers. Many different zoomable image technologies are supported.
https://dezoomify.ophir.dev
GNU General Public License v2.0
675 stars 75 forks source link

Dezoomify Website vs Node-Application #158

Open colossatr0n opened 7 years ago

colossatr0n commented 7 years ago

I'm trying to figure out how to retrieve the same file, format, and size that the Dezoomify website gives me by using the node-application. I'm unsure why, but when I use a URL e.g. http//:www.example.com/image on the Dezoomify website, it retrieves a .png with a size of 1.8 MB, but when I use this exact same URL in the node-application with the following codes, I get a .png of size 201 KB and a .jpg of 201 KB:

node dezoomify-node.js "http//:www.example.com/image" "result.png"

OR

node dezoomify-node.js "http//:www.example.com/image" "result.jpg"

Is there a way for me to obtain the same results using the node-application that I'm getting from the Dezoomify website? I'm trying to get the node-application to retrieve the 1.8 MB .png file.

lovasoa commented 7 years ago

The png file you save from your browser is created by your browser. Dezoomify just assembles the tiles, and the browser creates a file from the canvas dezoomify filled. Different browsers or different​versions of the same browser may create different files.

The node application uses a node canvas implementation, and saves the result as a jpeg file. Because you name the file result.png doesn't make it a png file.

If you create a clean pull request with file extension detection, that makes dezoomify save a png file when the extension of the output file is .png, then I'll merge it.

What kind of images are you working​ with? For photographs and paintings, png is usually a poor choice, creating huge files with no visible quality gains.

colossatr0n commented 7 years ago

Thank you for explaining all of that. That makes sense and clears things up. I'm working with high quality scans of old manuscripts and documents. Though the quality of both images is very good, the quality of the PNG that is created when using the Dezoomify website and my browser (Chrome) is better than what the node-application creates. With these scans I need to be able to zoom in quite a bit while retaining quality.