Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image output format and quality support #23

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@manuelbua
Copy link

commented Jun 15, 2019

This pull request adds support for user-specified output image format and quality: PhantomJS already supports this, so it was only a matter of passing it the correct parameters.

Two optional arguments have been added to the Python main driver:

  • --format, will accept any of the supported formats pdf, png, jpg, jpeg, bmp, ppm, defaults to png
  • --quality, will accept any integer in the range [0, 100], defaults to 70

The default file format has not changed and it's still png, this to avoid breaking other tools that may be based on webscreenshot.

By simply switching to jpg and making use of the default quality at 70, the space being used by hundred of images will now decrease up to ~70% in my tests, sometimes even higher (ie. 50 screenshots, png size is ~42Mb, jpg size is ~10Mb - Yahoo homepage, png size if 1.8Mb, jpg size is 400Kb).

@manuelbua manuelbua changed the title Add format quality support Add image output format and quality support Jun 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.