问题描述
在Jupyter lab
(Jupyter notebook
)记事本(notebook)中单元格中包含图片的情况有三种:
- 在markdown单元格中显示图片。
- 以markdwon语法插入本地图片。
- 复制图片、粘贴到单元格中,以图片附件形式保存在单元格中。
- 代码单元格的输出中的图片。
但是Jupyter lab
并不提供单元格直接导出图片的功能,如何将记事本中的图片导出呢?
分析问题
复制、粘贴图片到markdown单元格中
将上图复制粘贴到markdown单元格中。
运行后效果如下:
以文本形式打开.ipynb
文件,可以发现以附件形式出现的图片,并不以文件形式保存在磁盘上,而是以Base64编码形式直接保存在.ipynb
文件中 。
"cells": [
{
"attachments": {
"ab7cc708-c91c-4147-89d4-2dbcfa4a361a.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAMkAAABRCAYAAAB484IrAAAWpklEQVR4nO2d+VtTSbrH51+g7yzPzL3Y3dMzfe+llxG7dVoHQcEd0bigKOMGiqKAgiK7EPaQBEhYVJYmCCgggoggi4goighCRFRsEcUFhEACCRCk7fneH7hGTk6SQ6I24NQPn+fx4VS9VZW831TVW28dfyNVjIJAIGjnN5PdAQJhqkNEQiAwQERCIDBAREIgMEBEQiAwQERCIDBAREIgMEBEQiAwQERCIDBAREIgMEBEQiAwQERCIDBAREIgMEBEQiAwQERCIDBAREIgMEBEQiAwQERCIDAwLUXScq0Ot8oqJr0fhH8PppVIXjztQtquHWCbmqAmJxdSxSgayypRk50z6X0jfLxMG5H0SPoRt8YGbFMTsE1NUHf2HE4e8gDb1ARVovRJ7x/h42XaiKSIG6USCNvUBJHzf1D9+zyfN+n9I3y8TGmR9PUrIa68jBxvT4TOmUkRiToxy61wJigQDRfK0ds3OOl9J3w8TEmRSHoVKIuPR5TlfJ3C0AZviQUui9KJWAjvhSknkhsFhYheZmWQODSJpTavYNLHRJjeTBmRdHfLkOGy972IQ51cHy/09A5M+hgJ05MpIZL21keIW7PygwjkDUKWNdrvPZz0sRKmH5Mukp/ELeCYz/2gAnkDf7E5Hrc+mvQPnTC9mFSRdLR1gL/Y/Fc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QUqq2qQln4CoWHh8PP3h4+PD0LDwhEriENBYbHeF7B6ZMNobL6P8yXlSE1LR3SsEMHBofD19cWRwEBworiITziK/LPn0XyvDX0GHJ5eulyDGIEQMQIhaus13/icCK2PniE+4ShiBXEoNzCtXx8mXSSqL158F1lueyE7z2dcOg2VCzFUkoBhtYRETUiKuMhyc8ajFv1eFUQgvGHKiESqGEWvbBhVx+LRqePkXR+en+GiKvkY+j7A3XPCvw9TSiRvuJ6XhyuxITrTVHTRWcBFdWwIbuST/wqO8O5MSZFIFaPoGxjBrdIKXIyLRk0CB9diA9EiisDDkxw8yY3C83wunuRw8DCLg+Yfw1ETcwQ1iVGoiItBY0XllEw4JExPpqxI1OntG0T73Z/QWt+I5uoaNJZVorm6Bq0NTWi/+5NeCYoEgj5MG5EQCJMFEQmBwAARCYHAABEJgcAAEQmBwAARCYHAABEJgcAAEQmBwAARCYHAABEJgcAAEQmBwAARCYHAABEJgcAAEQmBwAARCYHAABEJgcAAEQmBwAARCYHAwP8Bmi/X7zPD+MsAAAAASUVORK5CYII="
}
},
"cell_type": "markdown",
"metadata": {},
"source": [
"![图片.png](attachment:ab7cc708-c91c-4147-89d4-2dbcfa4a361a.png)"
]
}
],
将上述Base64编码还原为图片,如下所示。
代码单元格输出图片
在代码单元格中输入以下内容并运行。
以文本形式打开.ipynb文件。
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x1957058a2e8>]"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAObElEQVR4nO3cf6jd9X3H8edLY1pGdXbmTlySmpZFMHUy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P+9D7RqSePoXSfJZ4Fp4PxJz7KckhwD/BVw5YRHGbdV9C7fXEDvp7ZdSX6lql6Z5FDL7DLgjqr6apKPAV9PckZV/WzSg60UK/GMfh+wvu/5um7bQY9Jsorej3v/MZbplscwaybJbwE3ABdX1f+MabblMmjNxwNnAA8l+TG9a5k7V/gN2WH+nOeAnVX1v1X1b8Az9MK/Ug2z5s8BdwNU1cPAe+n9z79aNdS/98OxEkP/CLAxyQeTrKZ3s3XngmN2Ald0j38XeKC6uxwr1MA1JzkL+Ft6kV/p121hwJqr6tWqWlNVG6pqA737EhdX1cxkxh2JYf5uf5ve2TxJ1tC7lPPcGGcctWHW/DzwSYAkp9ML/fxYpxyvncDl3btvzgVeraqXlvKCK+7STVW9meRa4F56d+y3V9XeJDcBM1W1E/g7ej/ezdK76XHp5CZeuiHXfDPwPuAfu/vOz1fVxRMbeomGXHNThlzzvcCnkjwJvAX8aVWt2J9Wh1zznwBfS/JH9G7MXrmST9yS3Envm/Wa7r7DjcBxAFV1O737EBcBs8DrwFVL/por+L+XJGkIK/HSjSTpMBh6SWqcoZekxhl6SWqcoZekxhl6SWqcoZekxv0fi4CaHnY3t8AAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"plt.plot([1, 1])"
]
}
],
将上述Base64编码还原为图片,如下所示。
markdown单元格本地文件
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![Image](1.png) "
]
}
],
结论
markdown单元格中的粘贴来的临时图片和代码单元格生成的图片都是以附件(Base64编码)形式直接保存在ipynb
文件中。如果本地没有保存或者上传图片,可以通过Base64编码保存图片。
markdown单元格中的本地图片将不会保存在ipynb
文件中,仍然以本地文件形式存储。