How to change Texture properties via python?
Recast the type
For objects that can have their types changed can recast the types using type_recast
&gt;&gt;&gt; tex.type_recast(
type_recast()
.. method:: type_recast()
Return a new instance, this is needed because types
such as textures can be changed at runtime.
:return: a new instance of this object with the type initialized again.
:rtype: subclass of :class:`bpy.types.bpy_struct`

try it out in console.
&gt;&gt;&gt; tex = D.textures.new(&quot;Tex&quot;, 'STUCCI')
&gt;&gt;&gt; tex.name
'Tex'

&gt;&gt;&gt; tex.type
'STUCCI'

&gt;&gt;&gt; tex.image
Traceback (most recent call last):
  File &quot;&lt;blender_console&gt;&quot;, line 1, in &lt;module&gt;
AttributeError: 'StucciTexture' object has no attribute 'image'

&gt;&gt;&gt; tex.type = 'IMAGE'
&gt;&gt;&gt; foo = tex.type_recast()
&gt;&gt;&gt; foo.image is None
True

&gt;&gt;&gt; foo.name
'Tex'

&gt;&gt;&gt; foo
bpy.data.textures['Tex']

Notice too the two instances keep there type
&gt;&gt;&gt; str(tex)
'&lt;bpy_struct, StucciTexture(&quot;Tex&quot;) at 0x7f89ff16b448&gt;'

&gt;&gt;&gt; str(foo)
'&lt;bpy_struct, ImageTexture(&quot;Tex&quot;) at 0x7f89ff16b448&gt;'

btw, if while checking this out in console the properties area is open on same screen, it is being done automatically for us.