得到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工具

相关文章
相关标签/搜索