From 1cc2f950e183112b41bdf095694c133ad0221ab1 Mon Sep 17 00:00:00 2001 From: "Alan L. V. Guedes" Date: Mon, 26 Jul 2021 16:49:08 +0100 Subject: [PATCH] fix usage of decrepted bytescale --- dct_better_explained.ipynb | 6 +++--- dct_experiences.ipynb | 1 - uniform_quantization_experience.ipynb | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dct_better_explained.ipynb b/dct_better_explained.ipynb index 67a69ef..1e94a62 100644 --- a/dct_better_explained.ipynb +++ b/dct_better_explained.ipynb @@ -25,7 +25,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from scipy import fftpack\n", - "from scipy.misc import bytescale\n", + "from skimage.util import img_as_ubyte\n", "import matplotlib.image as mpimg" ] }, @@ -59,7 +59,7 @@ ], "source": [ "# loading a simple Z character image (8x8)\n", - "img = bytescale(mpimg.imread('i/z_char_8x8.png'))\n", + "img = img_as_ubyte(mpimg.imread('i/z_char_8x8.png'))\n", "img_h = 8\n", "gray_img = img[:,:,0]\n", "\n", @@ -179,7 +179,7 @@ } ], "source": [ - "dct_basis = bytescale(mpimg.imread('i/dct_basis.png'))\n", + "dct_basis = img_as_ubyte(mpimg.imread('i/dct_basis.png'))\n", "plt.imshow(dct_basis, cmap='gray', interpolation='nearest')" ] }, diff --git a/dct_experiences.ipynb b/dct_experiences.ipynb index f067309..ba21179 100644 --- a/dct_experiences.ipynb +++ b/dct_experiences.ipynb @@ -25,7 +25,6 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from scipy import fftpack\n", - "from scipy.misc import bytescale\n", "import matplotlib.image as mpimg" ] }, diff --git a/uniform_quantization_experience.ipynb b/uniform_quantization_experience.ipynb index f6e37c1..95b0a6d 100644 --- a/uniform_quantization_experience.ipynb +++ b/uniform_quantization_experience.ipynb @@ -25,7 +25,7 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from scipy import fftpack\n", - "from scipy.misc import bytescale\n", + "from skimage.util import img_as_ubyte\n", "import matplotlib.image as mpimg" ] }, @@ -38,7 +38,7 @@ "outputs": [], "source": [ "# loading image\n", - "img = bytescale(mpimg.imread('i/super_mario_head.png'))\n", + "img = img_as_ubyte(mpimg.imread('i/super_mario_head.png'))\n", "choosen_y_x = 90\n", "resolution = 128\n", "\n",