【发布时间】:2018-11-19 03:48:43
【问题描述】:
【问题讨论】:
-
为什么要先用notepad++打开一个png?
-
因为提示建议我这样做。实际上,当我用浏览器打开它时,我从源代码中找到了一个 base64 代码,对其进行解码并且竞争是相同的
【问题讨论】:
我不会说这是加密的,更像是以这样一种方式编码,即每个白色像素都应该是数字字符,而其他字符应该显示为黑色。这很容易解码,然后你可以使用你最喜欢的图像构建/操作库来重新创建图像。
这是一个使用简单pypng 模块的示例:
import png
with open("misc.png", "r") as f: # open the file for reading and...
# ... read the file line by line and store numbers as white and others as black pixels
data = [[pixel.isdecimal() for pixel in line] for line in f]
png.from_array(data, "L", {"bitdepth": 1}).save("decoded.png") # use pypng to save it as PNG
对于misc.png 中的链接数据,将产生decoded.png:
【讨论】: