NoneType error in Python Processing

By “variable I created to hold an image”, do you mean the picture variable? If so, I think I’ve solved your NoneType error … but then ran into other types of errors. Perhaps this will get you moving forward?

image_name = "image.png"
particles_number = 100
magnetic_constant = 255

import math
def setup():
    global picture
    background(255)
    stroke(0)
    picture = loadImage(image_name)
    image(picture, 0, 0)
    size(512 * 2 + 2, 512)
    #create_particles(particles_number)
    #draw_particles(picture.width)
    
'''
...

'''

def draw():
    #move_particles()
    #draw_particles(picture.width)
    print(picture.width)
1 Like