Generate and optimise thumbnails using GraphicsMagick and pngquant Install Install gm and pngquant. apt-get install gm pngquant Generate Generate a thumbnail. You can replace -thumbnail with -resize for a clearer thumbnail that will result in a larger file size.