Screenshot of a particular quality with Ruby and Puppeteer

Install Puppeteer and Grover

npm i puppeteer
gem install grover

Configure Grover

Note that the quality is a number between 0 and 100 and is ignored if the output is not a JPEG.

require 'grover'

Grover.configure do |config|
  config.options = {
    screenshot: {
      type: 'jpeg',
      quality: 75

Take a screenshot of the resized viewport and save to file"quality.jpg", "wb") do |f|

Find out how to take a retina screenshot with Ruby and Puppeteer.

We created Urlbox to make converting HTML to images easy

Learn more about our website screenshot API.