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).
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 formatspdf, png, jpg, jpeg, bmp, ppm
, defaults topng
--quality
, will accept any integer in the range[0, 100]
, defaults to70
The default file format has not changed and it's still
png
, this to avoid breaking other tools that may be based onwebscreenshot
.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).