How can I decrease the size of textures in my blend file programmatically?
Asked many times

To quickly scale all images in .blend to given size:

import bpy
for img in bpy.data.images:
    try:
        # for empty render result image, etc.
        img.scale(512, 512) # (width, height)
    except:
        pass