Actually, it looks fine now, its just that it appeared that you were passing img since in a procedural program this is what you would do. Instead, when making methods, you dont pass the object that is being operated on. Also, if you have a function where you pass in a type to modify, particularly if it is a function within a type, it should probably be a method instead.