Skip to content

Instantly share code, notes, and snippets.

@hmaarrfk
Created May 31, 2018 18:12
Show Gist options
  • Save hmaarrfk/3d767411d19a131b20f8557c512381e1 to your computer and use it in GitHub Desktop.
Save hmaarrfk/3d767411d19a131b20f8557c512381e1 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.3.0\n"
]
}
],
"source": [
"import imageio\n",
"print(imageio.__version__)\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'imageio.core.util.Image'>\n"
]
}
],
"source": [
"a = imageio.imread('https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png')\n",
"print(a.__class__)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'numpy.int32'>\n"
]
}
],
"source": [
"b = a[0, 0, 0] + 1\n",
"print(b.__class__)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'imageio.core.util.Image'>\n"
]
}
],
"source": [
"c = a[:, 0, 0] + 1\n",
"print(c.__class__)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment