<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://gisaxs.com/index.php?action=history&amp;feed=atom&amp;title=Python%3AImages</id>
	<title>Python:Images - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://gisaxs.com/index.php?action=history&amp;feed=atom&amp;title=Python%3AImages"/>
	<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=Python:Images&amp;action=history"/>
	<updated>2026-04-08T22:36:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>http://gisaxs.com/index.php?title=Python:Images&amp;diff=6090&amp;oldid=prev</id>
		<title>KevinYager: Created page with &quot;==ndimage.imread== ndimage.imread has been deprecated. Here are alternatives. &lt;source lang=&quot;python&quot;&gt;     #image = scipy.misc.imread(infile) # Deprecated     image = imageio.im...&quot;</title>
		<link rel="alternate" type="text/html" href="http://gisaxs.com/index.php?title=Python:Images&amp;diff=6090&amp;oldid=prev"/>
		<updated>2020-08-28T14:56:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==ndimage.imread== ndimage.imread has been deprecated. Here are alternatives. &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;     #image = scipy.misc.imread(infile) # Deprecated     image = imageio.im...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==ndimage.imread==&lt;br /&gt;
ndimage.imread has been deprecated. Here are alternatives.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
    #image = scipy.misc.imread(infile) # Deprecated&lt;br /&gt;
    image = imageio.imread(infile)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Helpers:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def sm_imresize(image, size, handle_float=False):&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;Replacement for deprecated scipy.misc.imresize function.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    #image = scipy.misc.imresize(image, size) # Deprecated&lt;br /&gt;
    &lt;br /&gt;
    h, w, c = image.shape&lt;br /&gt;
    if isinstance(size, (int, float)):&lt;br /&gt;
        hn = int(h*size)&lt;br /&gt;
        wn = int(w*size)&lt;br /&gt;
    elif len(size)==2:&lt;br /&gt;
        hn, wn = size&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;#039;Error in sm_imresize.&amp;#039;)&lt;br /&gt;
    &lt;br /&gt;
    if handle_float:&lt;br /&gt;
        image = np.copy(image)*255&lt;br /&gt;
        image = np.array( Image.fromarray( image.astype(np.uint8) ).resize((wn,hn)) )&lt;br /&gt;
        image = image/255&lt;br /&gt;
    else:&lt;br /&gt;
        image = np.array( Image.fromarray( image.astype(np.uint8) ).resize((wn,hn)) )&lt;br /&gt;
        #image = resize(image, output_shape=(hn,wn), preserve_range=True) # Doesn&amp;#039;t work&lt;br /&gt;
                        &lt;br /&gt;
    return image&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def sm_imread(infile):    &lt;br /&gt;
    #image = scipy.misc.imread(infile) # Deprecated&lt;br /&gt;
    image = imageio.imread(infile)&lt;br /&gt;
    if image.ndim==2:&lt;br /&gt;
        # Convert single-channel (grayscale) to 3-channel&lt;br /&gt;
        image = np.stack((image,)*3, axis=-1)&lt;br /&gt;
    #h, w, c = image.shape&lt;br /&gt;
    #aspect_ratio = w/h&lt;br /&gt;
    &lt;br /&gt;
    return image&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>KevinYager</name></author>
		
	</entry>
</feed>