得到Google Art Project(Google 藝術計劃)的圖片

得到Google Art Project(Google 藝術計劃)的圖片

前言

Google Art Project是我Chrome必備的插件,它的功能是天天爲安裝者提供一副精美的藝術畫,
安裝以後的效果以下圖:
html

全屏以後就像畫框同樣:
python

獲取圖片

可是圖片是沒法直接從瀏覽器下載的,由於圖片在網頁中被設置爲CSS background,下面就介紹下如何從瀏覽器直接獲取
這些圖片。web

首先點擊途中紅色連接
chrome

而後將選中的內容拷貝到一個文本文件內
api

將文件命名爲例如mountain.txt,而後將文件內容進行解碼瀏覽器

#! /usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import os

file_content = open('mountain.txt').read()
file_content = file_content[27:-1]
file_content = base64.b64decode(file_content)
open('mountain','wb').write(file_content)
os.system('dwebp.exe mountain -o mountain.png')

最後會獲得質量較高的圖片
app

dwebp 下載

dwebp是Google開源的將webp格式轉換成png格式的工具下載地址爲https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html工具

相關文章
相關標籤/搜索