kazurayam / VisualInspectionOfExcelAndPDF

A sort of page scraping tool that is capable of detecting changes in the attached Excel / PDF files
0 stars 0 forks source link

want to make screenshot PNG files smaller in byte size #22

Open kazurayam opened 1 year ago

kazurayam commented 1 year ago

The VisualInspection projects produce a lot of PNG image files, each could be as large as maga-bytes. It is preferable if it can produce PNG files of smaller size.

There are several utilities that compress PNG file into smaller size. For example

Onece I evaluted it and found it's usefule:

Once I thought that the materialstore library to integrate Pngquant

https://github.com/kazurayam/materialstore/issues/412

but now I think that the materialstore library should NOT be dependent on the pngquant library.

I think that each application project, such as VisualInspactionOfExcelAndPDF, can optionally use the pngquant. It is up to each users.

kazurayam commented 1 year ago

I have created a new branch "issue22" where I developed a new Groovy class

and I created a Test Case

Then I reviewd Test Cases/NISA/materialize and found that the "materialize" script can not use the PngquantSupport class. Why?

The materialize script uses the Mapper to map a PDF into a set of PNGs.

So the materialstore-mapper library should support a mapping from a PNG to a smaller PNG.

kazurayam commented 1 year ago

well, well, ... still a long way to go

kazurayam commented 1 year ago

How about tinify?

How aβout Aspose

How about Imagej

kazurayam commented 1 year ago

Alternative idea: the materialstore-mapper library to support conversion methods

and these conversion should support a parameter of compression.

kazurayam commented 1 year ago

The VisualInspectionOfExcepAndPDF does PDF to PNG conversion. But, in fact, PDF to PNG conversion is not very useful. In the business scene it is unlikely that we use PDF to PNG version.

kazurayam commented 1 year ago

In many Visual Studio project, I use either of the following 2 methos to take a screenshot of web page displayed in browser.

Both of them generates PNG images.

How to take a screenshot of browser and save as a JPEG image?

kazurayam commented 1 year ago

I have updated my ashotwrapper project so that I am able save web page screenshots in JPEG format.

Using the updated ashotwrapper, I have done a study and wrote a report how much JPEG helps to reduce the size of files.

How much effective JPEG could be to reduce the size of screenshot files? --- It depends on the type (design) of the target web page. If the target is phot-rich page, then JPEG is effective. If the target is text-only page, then JPEG is not effective; PNG will do.

kazurayam commented 1 year ago

I have found out that JPEG is not suitable for screenshot of the text-only pages. PNG is better.